dreedgibson
New Member
- Joined
- Nov 16, 2015
- Messages
- 2
All,
This is my first post to this board, I have tried searching the board and I haven't been able to come up with an answer. I am fairly new to VBA and have a question regarding the on double click private sub and how to assign it to shapes (CTRL click would work as well). I have a sheet that reads an input from range B3:B11 and creates an appropriate number of shapes based on the numbers it reads...
For example Cell A3 is PLEM Cell B3 is 6 thus it creates 6 PLEM shapes in a new build sheet.
With that in mind the following code creates the manifold shapes:
where iman is taken from cell B7 and in this case is 3 (three shapes will be created)
I am most concerned with the bolded line, the goal of the sheet is to be able to rearrange the icons to look like a proper field layout.
However, when the Manifold shapes are clicked, the ManifoldClick sub is run. I would rather have the sub run after a double click so that the shapes can be moved around without annoyance.
Is it possible to assign a double click action in this section of code? If there is, I will be trying to assign it to every shape in the sheet.
Any help would be appreciated, also please feel free to tell me I didn't look enough if there is a thread that I missed that has an answer to something like this.
If you would rather view the spreadsheet send me a PM of your email and I will send it on through,
Thanks very much,
DRG
This is my first post to this board, I have tried searching the board and I haven't been able to come up with an answer. I am fairly new to VBA and have a question regarding the on double click private sub and how to assign it to shapes (CTRL click would work as well). I have a sheet that reads an input from range B3:B11 and creates an appropriate number of shapes based on the numbers it reads...
For example Cell A3 is PLEM Cell B3 is 6 thus it creates 6 PLEM shapes in a new build sheet.
With that in mind the following code creates the manifold shapes:
Code:
For i = 1 To iman
Set man(i, 1) = ws.Shapes.AddShape(65, (i - 1) * 110 + 465, 315, 100, 100)
man(i, 1).Name = Sheets("Instructions").Range("A7").Value & i
man(i, 1).TextFrame.Characters.Text = Sheets("Instructions") _
.Range("A7").Value & i
man(i, 1).TextFrame.HorizontalAlignment = xlHAlignCenter
man(i, 1).TextFrame.VerticalAlignment = xlVAlignCenter
man(i, 1).Fill.ForeColor.RGB = RGB(223, 251, 53)
man(i, 1).TextFrame.Characters.Font.ColorIndex = 1
[B] man(i, 1).OnAction = "ManifoldClick" & i[/B]
ActiveCell.Offset(iplem + ipl + itree + ijumper + i - 1, 0).Value = man(i, 1).Name
Next i
where iman is taken from cell B7 and in this case is 3 (three shapes will be created)
I am most concerned with the bolded line, the goal of the sheet is to be able to rearrange the icons to look like a proper field layout.
However, when the Manifold shapes are clicked, the ManifoldClick sub is run. I would rather have the sub run after a double click so that the shapes can be moved around without annoyance.
Is it possible to assign a double click action in this section of code? If there is, I will be trying to assign it to every shape in the sheet.
Any help would be appreciated, also please feel free to tell me I didn't look enough if there is a thread that I missed that has an answer to something like this.
If you would rather view the spreadsheet send me a PM of your email and I will send it on through,
Thanks very much,
DRG