Combo box help

miket85

New Member
Joined
Dec 9, 2010
Messages
45
Hey guys,

I had a question regarding a combo box search function. Ultimately what I am try to accomplish is to have a combo box where the user can which column to search and another box will return the result. It sounds pretty simple right? Currently I have the program running a search function perfectly (user enters a number and the second box displays the related number from column 1), I want to modify it so that it will only search the column they require, so it wont cycle through all the columns.

Let me knwo if you need my code thahnks!!!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Private Sub ComboBox1_Change()

***This part throwing errors***
If ComboBox1.Value = "item 1" Then Set tbl = Sheet169.Range("B").CurrentRegion

ElseIf ComboBox1.Value = "item 2" Then Set tbl = Sheet169.Range("C").CurrentRegion

End If directly after this last line above?

It looks okay. I have never used the .currentregion so don't have any experience to lend you.
 
Upvote 0
Ok well i think i have narrowed down my issue. It seems i cannot get my ranges to identify with one column for each if-else statement.
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,522
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top