R
Richard
Hello,
The following macro places borders around the range
A650:
Sub myborders()
Dim ws As Worksheet
Dim Lastrow As Integer
Set ws = Sheets(1)
Lastrow = 50
With ws.Range("A6" & Lastrow)
With .Borders
.LineStyle = xlBorderLineStyleContinuous
.Weight = xlThin
End With
End With
End Sub
However, the project has several non-contiguous ranges
that require formatting with borders. I wish to achieve
this without repeating for each range, the code starting
with "With ws.range("A6" & Lastrow)".
This is the type of thing that I am looking for (this
syntax does not work):
With ws.range("A6" & Lastrow, "K6:L" & Lastrow, "P6:S"
& LastRow)
I will appreciate any suggestions on the above matter.
TIA
Richard
The following macro places borders around the range
A650:
Sub myborders()
Dim ws As Worksheet
Dim Lastrow As Integer
Set ws = Sheets(1)
Lastrow = 50
With ws.Range("A6" & Lastrow)
With .Borders
.LineStyle = xlBorderLineStyleContinuous
.Weight = xlThin
End With
End With
End Sub
However, the project has several non-contiguous ranges
that require formatting with borders. I wish to achieve
this without repeating for each range, the code starting
with "With ws.range("A6" & Lastrow)".
This is the type of thing that I am looking for (this
syntax does not work):
With ws.range("A6" & Lastrow, "K6:L" & Lastrow, "P6:S"
& LastRow)
I will appreciate any suggestions on the above matter.
TIA
Richard