Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Is is possible? and how?

I have a comboBox from toolbar. And in it i have list of items through the
ListFillRange.

The Combo Box looks as such:

Apple- Red
Apple-Green
Apple-Yellow
Watermelon
Orange
Banana

My question is: Is it possible to make a statement
where i say something like: [[" If ComboBox.Value="Apple" Then......]]

Note that as a Value I have only the word "Apple" and Im not specifying the
color.
I would like to make VB understand that the if statement applies to all
apples even if I dont specify the color like it shows in the combobox. I
could make an If statment for each apple but that would be alot of If's. I
have over 30 Apples! different colors


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Is is possible? and how?

Have a look at the LEFT function - it enables you to compare the
leftmost characters (5 in your case).

Hope this helps.

Pete

On Aug 1, 8:10 pm, M&M wrote:
I have a comboBox from toolbar. And in it i have list of items through the
ListFillRange.

The Combo Box looks as such:

Apple- Red
Apple-Green
Apple-Yellow
Watermelon
Orange
Banana

My question is: Is it possible to make a statement
where i say something like: [[" If ComboBox.Value="Apple" Then......]]

Note that as a Value I have only the word "Apple" and Im not specifying the
color.
I would like to make VB understand that the if statement applies to all
apples even if I dont specify the color like it shows in the combobox. I
could make an If statment for each apple but that would be alot of If's. I
have over 30 Apples! different colors



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Is is possible? and how?

try:

Private Sub ComboBox1_Change()
If InStr(1, ComboBox1.Value, "Apple") Then
MsgBox "Apple selected"
End If
End Sub

"M&M" wrote:

I have a comboBox from toolbar. And in it i have list of items through the
ListFillRange.

The Combo Box looks as such:

Apple- Red
Apple-Green
Apple-Yellow
Watermelon
Orange
Banana

My question is: Is it possible to make a statement
where i say something like: [[" If ComboBox.Value="Apple" Then......]]

Note that as a Value I have only the word "Apple" and Im not specifying the
color.
I would like to make VB understand that the if statement applies to all
apples even if I dont specify the color like it shows in the combobox. I
could make an If statment for each apple but that would be alot of If's. I
have over 30 Apples! different colors


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Is is possible? and how?


Thank you !!

Always appreciate the help you all provide

"Toppers" wrote:

try:

Private Sub ComboBox1_Change()
If InStr(1, ComboBox1.Value, "Apple") Then
MsgBox "Apple selected"
End If
End Sub

"M&M" wrote:

I have a comboBox from toolbar. And in it i have list of items through the
ListFillRange.

The Combo Box looks as such:

Apple- Red
Apple-Green
Apple-Yellow
Watermelon
Orange
Banana

My question is: Is it possible to make a statement
where i say something like: [[" If ComboBox.Value="Apple" Then......]]

Note that as a Value I have only the word "Apple" and Im not specifying the
color.
I would like to make VB understand that the if statement applies to all
apples even if I dont specify the color like it shows in the combobox. I
could make an If statment for each apple but that would be alot of If's. I
have over 30 Apples! different colors


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



All times are GMT +1. The time now is 12:56 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"