Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find the 4 parameters in order to design one line

Hello to all and excused for my bad English

With following macro I can easily draw a line

sub draw_line ()
Xp1 = 1
Yp1 = 60
Xp2 = 1900
Yp2 = 60
ActiveSheet.Shapes.AddLine (Xp1, Yp1, Xp2, Yp2). Name = "line1"
end sub

We suppose that with a successive macro I want to determine the used
parameters in order to trace the line1.
What's the method to determine the 4 used parameters in order to trace the
line through code VBA; that is Xp1 Yp1 Xp2 Yp2?

Thanks for the attention.
Diego.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Find the 4 parameters in order to design one line

'-------------------------------------------
Sub draw_line()
Dim Xp1 As Single, Yp1 As Single
Dim Xp2 As Single, Yp2 As Single
Xp1 = 1
Yp1 = 60
Xp2 = 1900
Yp2 = 60
ActiveSheet.Shapes.AddLine(Xp1, Yp1, Xp2, Yp2).Name = "line1"
End Sub

Sub get_line_coord()
Dim Xp1 As Single, Yp1 As Single
Dim Xp2 As Single, Yp2 As Single
Dim shLine As Shape
Set shLine = ActiveSheet.Shapes("line1")
Xp1 = shLine.Left
Yp1 = shLine.Top
Xp2 = Xp1 + shLine.Width
Yp2 = Yp1 + shLine.Height
MsgBox "P1: " & Xp1 & ", " & Yp1 & vbCrLf & _
"P2: " & Xp2 & ", " & Yp2
End Sub
'-------------------------------------------------

HTH
--
AP

"skimer" a écrit dans le message de news:
...
Hello to all and excused for my bad English

With following macro I can easily draw a line

sub draw_line ()
Xp1 = 1
Yp1 = 60
Xp2 = 1900
Yp2 = 60
ActiveSheet.Shapes.AddLine (Xp1, Yp1, Xp2, Yp2). Name = "line1"
end sub

We suppose that with a successive macro I want to determine the used
parameters in order to trace the line1.
What's the method to determine the 4 used parameters in order to trace the
line through code VBA; that is Xp1 Yp1 Xp2 Yp2?

Thanks for the attention.
Diego.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Find the 4 parameters in order to design one line

Look at the left, top, height and width properties of the Shape object.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"skimer" wrote in message
...
Hello to all and excused for my bad English

With following macro I can easily draw a line

sub draw_line ()
Xp1 = 1
Yp1 = 60
Xp2 = 1900
Yp2 = 60
ActiveSheet.Shapes.AddLine (Xp1, Yp1, Xp2, Yp2). Name = "line1"
end sub

We suppose that with a successive macro I want to determine the used
parameters in order to trace the line1.
What's the method to determine the 4 used parameters in order to trace the
line through code VBA; that is Xp1 Yp1 Xp2 Yp2?

Thanks for the attention.
Diego.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find the 4 parameters in order to design one line

Perfect !!!
Thanks of all ;-)))


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
URGENT- Form design and field tab-order problems Foxcole Excel Discussion (Misc queries) 5 March 26th 09 03:38 PM
I need a basic quick time line design clt64 Excel Discussion (Misc queries) 1 February 14th 08 07:46 PM
Order form design Learner101b Excel Discussion (Misc queries) 3 December 18th 07 10:51 PM
Series order conflicts with line order Cowtoon Charts and Charting in Excel 3 January 15th 06 08:43 PM
passing parameters from command line Albrecht Hesmert Excel Programming 5 February 11th 04 03:20 PM


All times are GMT +1. The time now is 02:50 PM.

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

About Us

"It's about Microsoft Excel"