ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using a Combo Box text selection to find text on another worksheet (https://www.excelbanter.com/excel-programming/432368-using-combo-box-text-selection-find-text-another-worksheet.html)

Nickis

Using a Combo Box text selection to find text on another worksheet
 
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.Combo Box1.Text).Select

Any help or input would be appreciated.

Nicki



Jacob Skaria

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

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

If this post helps click Yes
---------------
Jacob Skaria


"Nickis" wrote:

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.Combo Box1.Text).Select

Any help or input would be appreciated.

Nicki




All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com