SanjayGMusafir
Well-known Member
- Joined
- Sep 7, 2018
- Messages
- 1,503
- Office Version
- 2021
- Platform
- MacOS
Hi Experts
Need some help
I want to Copy Paste Only Border Style and No Other Formatting in Excel for Mac 2019
I got this code from some site, but it copies entire formatting. Please help me improve the code specific to my needs. Thanks a lot ?
Need some help
I want to Copy Paste Only Border Style and No Other Formatting in Excel for Mac 2019
I got this code from some site, but it copies entire formatting. Please help me improve the code specific to my needs. Thanks a lot ?
Code:
Sub CopyBorders()
'
' CopyBorders Macro
'
'
Dim xRg As Range
ActiveWorkbook.Styles("Normal").IncludeBorder = False
On Error Resume Next
Set xRg = Application.InputBox("", "Select Range to Copy Borders...", , , , , , 8)
With Application.InputBox("", "Select Range to Apply Borders...", , , , , , 8)
xRg.Copy
.PasteSpecial -4122
.Resize(xRg.rows.Count, xRg.Columns.Count).Style = "Normal"
End With
ActiveWorkbook.Styles("Normal").IncludeBorder = True
End Sub