Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Drawing lines to cells with VBA

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,3 1)

.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

--
Regards,
Tom Ogilvy

"Werner" wrote in
message ...

Hi,

I have a couple of rows (which change in numbers of rows when I use
another macro) and I want to put a double line at the bottom of the
last row. I used the recorder to find the beginning of my code and then
I modified it for my specific needs. But it says that the method Range
of the object '_Global' failed. I need my line to be drawn from colomn
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




--
Werner
------------------------------------------------------------------------
Werner's Profile:

http://www.excelforum.com/member.php...o&userid=24304
View this thread: http://www.excelforum.com/showthread...hreadid=383607



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
drawing lines in Excel 2007 truenorth Charts and Charting in Excel 1 January 14th 09 05:01 AM
Drawing Lines In Excel 2007 Roadrunner Excel Discussion (Misc queries) 5 July 14th 08 01:18 PM
Drawing Horizontal Lines - Hi-Lo Range jaygreg Charts and Charting in Excel 1 November 8th 06 03:44 PM
Problem in Drawing Lines (AutoShapes) Jac Excel Discussion (Misc queries) 0 October 8th 06 08:45 AM
Problem in Drawing Lines (AutoShapes) Jac Excel Discussion (Misc queries) 0 October 8th 06 08:37 AM


All times are GMT +1. The time now is 12:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"