help Compare string to Combo box!!!

  • Thread starter Thread starter gwoodby
  • Start date Start date
G

gwoodby

How would you compare a variable to see if it was in a combobox??
I was Thinking maybe

If Variable = CboBox.Text but wouldnt that only compare it to the one
selected?
 
Try something like this:
Dim cnt as long
For cnt = 0 to CboBox.ListCount - 1
If Variable = CboBox.List(cnt) then
'Do Something
Else
'Do Something Else
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top