mferrisi
01-18-2008, 12:48 PM
I created some shapes so that OnAction, a macro is run.
For x = 1 to 3
wt.Shapes.AddTextbox(msoTextOrientationHorizontal, ColWidth + 5, z* 11.25, 11.25, 11.25).Name = "tb1" & x
wt.Shapes("tb1" & x).OnAction = "TestMacro"
Next x
Sub TestMacro(????)
ShapeText = Shapes(w).TextFrame.Characters.Text
'or other similar things
Is there a way to pass to the subroutine which shape was clicked to activate the macro, similar to the BeforeDoubleClick below?
Thank you very much,
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim x As Integer
Dim y As Integer
y = Target.Column
x = Target.row
'etc etc
For x = 1 to 3
wt.Shapes.AddTextbox(msoTextOrientationHorizontal, ColWidth + 5, z* 11.25, 11.25, 11.25).Name = "tb1" & x
wt.Shapes("tb1" & x).OnAction = "TestMacro"
Next x
Sub TestMacro(????)
ShapeText = Shapes(w).TextFrame.Characters.Text
'or other similar things
Is there a way to pass to the subroutine which shape was clicked to activate the macro, similar to the BeforeDoubleClick below?
Thank you very much,
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim x As Integer
Dim y As Integer
y = Target.Column
x = Target.row
'etc etc