Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default help Compare string to Combo box!!!

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?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default help Compare string to Combo box!!!

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
--
Charles Chickering

"A good example is twice the value of good advice."


" wrote:

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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare string HugeHard Excel Worksheet Functions 1 October 30th 08 04:59 AM
Compare string with integer hurriance[_8_] Excel Programming 2 June 26th 06 09:14 AM
String compare doesn't compare? Ken Soenen Excel Programming 1 January 16th 06 03:40 PM
Compare between String and Value using VBA coco Excel Programming 1 June 27th 05 10:42 PM
string compare with wildcards Marcus Hoffmann Excel Programming 0 April 26th 05 09:31 AM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"