Range Select Syntax

  • Thread starter Thread starter u473
  • Start date Start date
U

u473

I need to select LastRow, Columns L through N to draw a double line
before my Total row.
But, because my LastRow varies, my Range Select cannot be hard coded.
What is the proper Range Select Syntax to say something like
Range("L:N" & LastRow).select ?
..
LastRow = Range("L65000").End(xlUp).Row
Range("L23:N23").Select ' Range syntax to be corrected for variable
LastRow.
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Color = -3407872
.TintAndShade = 0
.Weight = xlThick
End With
..
Help appreciated,
J.P.
 
Once you have established the last row:

LastRow = Range("L65000").End(xlUp).Row

Then you can use that as your row reference in the range to create the
double line border.

With Range("L" & LastRow & ":N" & LastRow).Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Color = -3407872
.TintAndShade = 0
.Weight = xlThick
End Wotj

You do not have to select it.
 
No need to actually select the range... Try this...

Dim rng As Range

Set rng = Cells(Rows.Count, "L").End(xlUp).Resize(1, 3)
With rng.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Color = -3407872
.TintAndShade = 0
.Weight = xlThick
End With
 
Back
Top