Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
The following macro places borders around the range A6:D50: Sub myborders() Dim ws As Worksheet Dim Lastrow As Integer Set ws = Sheets(1) Lastrow = 50 With ws.Range("A6:D" & 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:D" & Lastrow)". This is the type of thing that I am looking for (this syntax does not work): With ws.range("A6:D" & Lastrow, "K6:L" & Lastrow, "P6:S" & LastRow) I will appreciate any suggestions on the above matter. TIA Richard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Indirect Function Doesn't like non-contiguous ranges | Excel Discussion (Misc queries) | |||
vlookup on non-contiguous ranges | Excel Worksheet Functions | |||
summing non contiguous ranges | Excel Discussion (Misc queries) | |||
Adding Non-Contiguous Ranges | Excel Discussion (Misc queries) | |||
sorting non contiguous ranges | Excel Discussion (Misc queries) |