Murray Brown
asked on
Excel VBA Best way to get border information of a cell
Hi. I need to get information about the border formatting of a cell.
I am using the following code that gets the following results, which is
very different to the information in the macro recorder when
I initially formatted the cell (shown at the bottom)
L = 1
C = -4105
W = 2
Dim L, C, W As String
L = Selection.Borders(xlEdgeTo p).LineSty le
C = Selection.Borders(xlEdgeTo p).ColorIn dex
W = Selection.Borders(xlEdgeTo p).Weight
MsgBox W
With Selection.Borders(xlEdgeTo p)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
I am using the following code that gets the following results, which is
very different to the information in the macro recorder when
I initially formatted the cell (shown at the bottom)
L = 1
C = -4105
W = 2
Dim L, C, W As String
L = Selection.Borders(xlEdgeTo
C = Selection.Borders(xlEdgeTo
W = Selection.Borders(xlEdgeTo
MsgBox W
With Selection.Borders(xlEdgeTo
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help. Thanks for the grade.
Thomas
Thomas
ASKER