Using a Combo Box text selection to find text on another worksheet

N

Nickis

Hi,
I have set up a combo box using an input range from another worksheet. I
want to be able to make a selection in the combo box and then have the macro
go to another worksheet and find the first instance of that selected text and
then loop through to find all subsequent instances of that selected text.
I'm stuck on the first part though, actually finding the text.

I found the following code which I thought would help, but I'm not sure of
the reference to 'UserForm1.ComboBox1'. I'm not sure how to reference the
specific combo box or it's text, and I'm not even sure if the code below is
correct.

Worksheets("SheetName").Cells.Find(UserForm1.ComboBox1.Text).Select

Any help or input would be appreciated.

Nicki
 
J

Jacob Skaria

Try

varSearch = Me.ComboBox1.Text
With Worksheets("Sheet1")
..Activate
..Cells.Find(varSearch).Select
End With

If this post helps click Yes
 

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

Top