Mightyginger
Programmer
Hi, first post guys so thanks in advance for any help you mgiht be able to give. As with all things, easy if you know the answer.
Need to create and delete comboboxes within a loop and have control over what the combobox is refered to e.g. Sheet1.ComboBox?
Current code
'Do Until counter = Sheet1.ComboBox3.Value
' Sheet1.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
' DisplayAsIcon:=False, Left:=1200, Top:=fromtop, Width:=58, Height:=15). _
' Select
' fromtop = fromtop + 30
' counter = counter + 1
'Loop
Where I've just hacked some macro recorder code. This creates multiple comboxes but I don't have any real control over what they're called (numbered).
Code to delete
ActiveSheet.Shapes("ComboBox50"
.Select
(this would be in a loop)
Main problem I have is that instead of referring to the object as "ComboBox50" I want to be able to it as ComboBox + some number which I can increment.
Any help would be appreciated (hope the post isn't too long).
Neil.
Need to create and delete comboboxes within a loop and have control over what the combobox is refered to e.g. Sheet1.ComboBox?
Current code
'Do Until counter = Sheet1.ComboBox3.Value
' Sheet1.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
' DisplayAsIcon:=False, Left:=1200, Top:=fromtop, Width:=58, Height:=15). _
' Select
' fromtop = fromtop + 30
' counter = counter + 1
'Loop
Where I've just hacked some macro recorder code. This creates multiple comboxes but I don't have any real control over what they're called (numbered).
Code to delete
ActiveSheet.Shapes("ComboBox50"
(this would be in a loop)
Main problem I have is that instead of referring to the object as "ComboBox50" I want to be able to it as ComboBox + some number which I can increment.
Any help would be appreciated (hope the post isn't too long).
Neil.