View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Werner[_17_] Werner[_17_] is offline
external usenet poster
 
Posts: 1
Default Drawing lines to cells with VBA


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?
Thx! :)

Werner





Sub Draw_Double_Line()

'Line that find the number of rows.
Let lstRw = Sheets("Formulaire").Range("a65536").End(xlUp).Row

With Worksheets("Formulaire")
Range("A:AE" & lstRw).Borders(xlDiagonalDown).LineStyle = xlNone
Range("A:AE" & lstRw).Borders(xlDiagonalUp).LineStyle = xlNone
Range("A:AE" & lstRw).Borders(xlEdgeLeft).LineStyle = xlNone
Range("A:AE" & lstRw).Borders(xlEdgeTop).LineStyle = xlNone
With Range("A:AE" & lstRw).Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = 1
End With
Range("A:AE" & lstRw).Borders(xlEdgeRight).LineStyle = xlNone

End With

End Sub



--
Werne
-----------------------------------------------------------------------
Werner's Profile: http://www.excelforum.com/member.php...fo&userid=2430
View this thread: http://www.excelforum.com/showthread.php?threadid=38360