JBShandrew
Board Regular
- Joined
- Apr 17, 2011
- Messages
- 54
I am trying to shorten the amount of lines I need to write to put a border around a range of cells, including the inside vertical and horizontal lines.
This works
With Range("$A$4:$H$36").Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Color = RGB(0, 0, 255)
End With
With Range("$A$4:$H$36").Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Color = RGB(0, 0, 235)
End With
With Range("$A$4:$H$36").Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Color = RGB(0, 0, 235)
End With
</PRE>
This does not work. Is there a similar way to this to have Excel draw all of the borders that I want?
with range("I2":K2").borders
.xlEdgeRight LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlEdgeTop LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlEdgeBottom LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlInsideHorizontal LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlInsideVertical LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
End With
</PRE>
Thank you in advance for the expert help,
Sincerely,
J.B.
This works
With Range("$A$4:$H$36").Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Color = RGB(0, 0, 255)
End With
With Range("$A$4:$H$36").Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Color = RGB(0, 0, 235)
End With
With Range("$A$4:$H$36").Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Color = RGB(0, 0, 235)
End With
</PRE>
This does not work. Is there a similar way to this to have Excel draw all of the borders that I want?
with range("I2":K2").borders
.xlEdgeRight LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlEdgeTop LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlEdgeBottom LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlInsideHorizontal LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
.xlInsideVertical LineStyle:=xlContinuous, Color:=RGB(0, 0, 255)
End With
</PRE>
Thank you in advance for the expert help,
Sincerely,
J.B.