Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring an array variable
Hi Bill,
Not sure the following is what you are looking for. Because you said you want the borders on several ranges I have included code demonstrating the use of Union for formatting multiple ranges. Note that the space and underscore at the end of a line is a line break in an otherwise single line of code. Sub BorderApplication() Dim X As Variant Dim N As Integer X = Array(xlEdgeLeft, _ xlEdgeRight, _ xlEdgeTop, _ xlEdgeBottom, _ xlInsideVertical, _ xlInsideHorizontal) Dim rngBorders As Range Set rngBorders = Union(Range("A1:C10"), _ Range("E1:F10"), _ Range("H1:J10")) For N = 0 To 5 With rngBorders.Borders(X(N)) .LineStyle = xlContinuous .ColorIndex = 0 .Weight = xlThin End With Next N End Sub -- Regards, OssieMac |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Declaring a tab name as a variable | Excel Programming | |||
Declaring a tab name as a variable | Excel Programming | |||
Help declaring array limit with variable? | Excel Programming | |||
Declaring variable as a dynamic array? | Excel Programming | |||
Declaring a variable? | Excel Programming |