Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I recorded a macro creating two lines (to represent an X over a field) ActiveSheet.Shapes.AddLine(31.5, 858.75, 607.5, 1077.75).Select Selection.ShapeRange.Flip msoFlipVertical ActiveSheet.Shapes.AddLine(30.75, 858.75, 607.5, 1077.75).Select Basicly, i want to change this to something like this: Worksheets("Invulblad").Shapes.AddLine(31.5, 858.75, 607.5, 1077.75) How can i refer to the line to create the same effect (but not using .Select and Selection.)?? Can i name my lines or objects?? PS. I drawed it through the drawing toolbox. If that matters. Cheers. Gunti |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'd like to simplify the question. How do i refer to a Shape to change it's
properties. I can probably figure out the properties by using the macro recorder. "Gunti" wrote: Hi, I recorded a macro creating two lines (to represent an X over a field) ActiveSheet.Shapes.AddLine(31.5, 858.75, 607.5, 1077.75).Select Selection.ShapeRange.Flip msoFlipVertical ActiveSheet.Shapes.AddLine(30.75, 858.75, 607.5, 1077.75).Select Basicly, i want to change this to something like this: Worksheets("Invulblad").Shapes.AddLine(31.5, 858.75, 607.5, 1077.75) How can i refer to the line to create the same effect (but not using .Select and Selection.)?? Can i name my lines or objects?? PS. I drawed it through the drawing toolbox. If that matters. Cheers. Gunti |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'd try:
Dim myShape as shape set myshape _ = Worksheets("Invulblad").Shapes.AddLine(31.5, 858.75, 607.5, 1077.75) Then work with myShape. Gunti wrote: Hi, I recorded a macro creating two lines (to represent an X over a field) ActiveSheet.Shapes.AddLine(31.5, 858.75, 607.5, 1077.75).Select Selection.ShapeRange.Flip msoFlipVertical ActiveSheet.Shapes.AddLine(30.75, 858.75, 607.5, 1077.75).Select Basicly, i want to change this to something like this: Worksheets("Invulblad").Shapes.AddLine(31.5, 858.75, 607.5, 1077.75) How can i refer to the line to create the same effect (but not using .Select and Selection.)?? Can i name my lines or objects?? PS. I drawed it through the drawing toolbox. If that matters. Cheers. Gunti -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
By declaring the variable correctly (as a shape):
Dim myShape as Shape You'll get VBA's intellisense to pop up each time you type: myshape. (that dot is important) You'll be able to see the properties and methods. Gunti wrote: I'd like to simplify the question. How do i refer to a Shape to change it's properties. I can probably figure out the properties by using the macro recorder. "Gunti" wrote: Hi, I recorded a macro creating two lines (to represent an X over a field) ActiveSheet.Shapes.AddLine(31.5, 858.75, 607.5, 1077.75).Select Selection.ShapeRange.Flip msoFlipVertical ActiveSheet.Shapes.AddLine(30.75, 858.75, 607.5, 1077.75).Select Basicly, i want to change this to something like this: Worksheets("Invulblad").Shapes.AddLine(31.5, 858.75, 607.5, 1077.75) How can i refer to the line to create the same effect (but not using .Select and Selection.)?? Can i name my lines or objects?? PS. I drawed it through the drawing toolbox. If that matters. Cheers. Gunti -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Attaching a drawing | Excel Discussion (Misc queries) | |||
Drawing toolbar. | Excel Worksheet Functions | |||
Drawing an Age Pyramid | Charts and Charting in Excel | |||
Drawing on Protected Sheet | New Users to Excel | |||
Drawing a circle on a protected sheet | Excel Discussion (Misc queries) |