Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I draw lines..??

Question is, how do I go about drawing lines in Excel with VBA? I want
to draw a line using the drawing tool, not Borders and Shading. Where
would I get more info on Drawing Objects. Any help would be greatly
appreciated.






------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I draw lines..??

A good start would be to turn on the macro recorder (tools=Macro=Record a
New macro)

then draw you lines manually. Change things as you would want. Turn off
the macro recorder and look at the code.

This is a good start at looking at what attributes and methods were
employed.

--
Regards,
Tom Ogilvy

"MIKEB" wrote in message
...
Question is, how do I go about drawing lines in Excel with VBA? I want
to draw a line using the drawing tool, not Borders and Shading. Where
would I get more info on Drawing Objects. Any help would be greatly
appreciated.






------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I draw lines..??

Thank you....But I am looking for as way to draw line relative to a row
and column, even if the row and column are resized.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default How do I draw lines..??

Cells have a Top and Left property that give their graphical location on a
worksheet.

"MIKEB" wrote in message
...
Thank you....But I am looking for as way to draw line relative to a row
and column, even if the row and column are resized.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I draw lines..??

Where's the disconnect?

I recorded ActiveSheet.Shapes.AddLine(261.75, 49.5, 307.5, 141#).Select

I figure out the width and height

? 307.5-261.75
45.75
? 141.0-49.5
91.5

Now I adjust the code relative to E9

Sub Macro3a()
Dim rng As Range
Set rng = Range("E9")
ActiveSheet.Shapes.AddLine rng.Left + 45.75, _
rng.Top + 91.5, rng.Left, rng.Top
End Sub

--
Regards,
Tom Ogilvy



MIKEB wrote in message
...
Thank you....But I am looking for as way to draw line relative to a row
and column, even if the row and column are resized.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





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
how to draw trend lines through only certain data points akh2103 Charts and Charting in Excel 3 April 3rd 23 11:09 AM
is there any built in function to draw lines krishnan Excel Worksheet Functions 2 June 22nd 09 01:31 PM
How cani draw maximum and minimum lines in a chart in excel? Alf Charts and Charting in Excel 1 March 31st 08 09:09 AM
VBA to draw lines of SPC Daniel Charts and Charting in Excel 4 July 31st 07 08:44 PM
draw different weight lines depending on the cell value birder1 Excel Discussion (Misc queries) 1 March 5th 07 10:53 PM


All times are GMT +1. The time now is 04:25 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"