Creating two buttons and code programmatically
I need to create two buttons (at the same time) and add code to them. Not the same code for both. Each one must call a sub. I know how to add a code to the first button or add code to subsequente buttons, but only if i run the code twice and i need them to be added both the first time i run the code. Tried for ... next already but didnt succeed.
Any suggestions?
Ignore this one, just read the previous.
This one is already solved, just read the previous, please.
This is the one I wanna change and t has another error. Two buttons are being positioned one above another. The ones from column "B".
Code:
For Each cl In [B5664,B5668,H5664] 'update this range to place buttons
i = i + 1
Set myCmdObj = TargetSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", _
Left:=cl.Left + 1, Top:=cl.Top + 1, Width:=202.5, Height:=32.25)
Any suggestions about this thread and the one before it?