Drawing lines to cells with VBA

W

Werner

Hi,

I have a couple of rows (which change in numbers of rows when I us
another macro) and I want to put a double line at the bottom of th
last row. I used the recorder to find the beginning of my code and the
I modified it for my specific needs. But it says that the method Rang
of the object '_Global' failed. I need my line to be drawn from colom
A to AE. Does anyone see where is the problem in my code? :confused:
Thx! :)

Werner
 
T

Tom Ogilvy

Sub Draw_Double_Line()

'Line that find the number of rows.
Let lstRw = Sheets("Formulaire").Range("a65536").End(xlUp).Row
With Worksheets("Formulaire").Cells(lstrw,1).Resize(1,31)

.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
With .Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = 1
End With
.Borders(xlEdgeRight).LineStyle = xlNone
End With

End Sub
 

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