Range Select Syntax

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.
 
J

JLGWhiz

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.
 
J

Jim Thomlinson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top