Please help with Find Function in Excel VBA

rogeryung

New Member
Joined
Mar 10, 2010
Messages
33
Hi, I'm trying to do the following:

Based on user input via drop down lists, a value will show up in cell W4. I want to have a macro button set up next to that value that will search the entire worksheet for whatever value shows up in cell w4. The trouble is that all I can find examples of are macros that search based on a text string that is either embedded in the macro, or a message box prompts the user to type in the text to search for.

Basically I want to eliminate the user having to type anything in addition to selecting via the drop down lists. Does anyone know what the vba syntax should be for that?

Thanks
Roger
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Just reference that cell's value for the What argument, eg:

Rich (BB code):
With ActiveSheet
    .Cells.Find(What:=.Range("W4").Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False)
End With
 
Upvote 0
thanks..I didn't know what the proper syntax was for that, but was what I was looking for. Thanks again!
Roger
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,508
Members
452,918
Latest member
Davion615

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