I've written some vb code to put a combo box on a worksheet
here it is
ActiveSheet.DropDowns.Add(390, 15, 47, 103.5).Select
With Selection
.ListFillRange = "$i$2:$i$" & s + 1
.LinkedCell = "$h$16"
.DropDownLines = s + 1
.Display3DShading = False
End With
This by itself works fine
But I want the vb code to wait until the user has selected a value from the Combo box before it executes the remaining code
so I've written this
x = 0
Do Until x > 0
If DropDowns.selectedindex = -1 Then
x = 0
Else
x = 1
End If
Loop
It does not work.
From 'googling' I've got some solutions that could deliver the "wait until a selection has been made"
But they all appear to reference the Combo Box name. For the life of me I can't seem to find, anywhere, how to find the name of the Combo Box?
Can anyone help with these problems:
(1) how do I find what the combo box is called?
(2) is there simple vb code that will pause until a selection has been made from the combo box
Apologies if these appear silly - I'm very (very) new to VB but have much programming experience
Thank you in advance
PS I'm using Excel 2007
here it is
ActiveSheet.DropDowns.Add(390, 15, 47, 103.5).Select
With Selection
.ListFillRange = "$i$2:$i$" & s + 1
.LinkedCell = "$h$16"
.DropDownLines = s + 1
.Display3DShading = False
End With
This by itself works fine
But I want the vb code to wait until the user has selected a value from the Combo box before it executes the remaining code
so I've written this
x = 0
Do Until x > 0
If DropDowns.selectedindex = -1 Then
x = 0
Else
x = 1
End If
Loop
It does not work.
From 'googling' I've got some solutions that could deliver the "wait until a selection has been made"
But they all appear to reference the Combo Box name. For the life of me I can't seem to find, anywhere, how to find the name of the Combo Box?
Can anyone help with these problems:
(1) how do I find what the combo box is called?
(2) is there simple vb code that will pause until a selection has been made from the combo box
Apologies if these appear silly - I'm very (very) new to VB but have much programming experience
Thank you in advance
PS I'm using Excel 2007