white_flag
Active Member
- Joined
- Mar 17, 2010
- Messages
- 331
Hello
I have the following code that will try to put some lines around cells that have values inside:
the code is like this but I received error 438 (Object doesn't support this property or method)
How can be this fixed?
error is starting from here:
I have the following code that will try to put some lines around cells that have values inside:
the code is like this but I received error 438 (Object doesn't support this property or method)
How can be this fixed?
error is starting from here:
Code:
With .Borders(xlEdgeTop)
Code:
Dim Cell As Range
With Sheets(strSheetName)
For Each Cell In Sheets(strSheetName).Range("B1:J23")
If Cell.Value > "" Then
With .Borders(xlEdgeTop)
.LineStyle = xlDot
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlDot
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlInsideHorizontal)
.LineStyle = xlDot
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next
End With