Add Search Box to Spreadsheet

G

Guest

How can I add a search box to a spreadsheet whereby:
- User types name in cell (say, cell D1 and then button assigned to macro is clicked)
- Column A is queried for value typed in D1
- Value matched in Column A is selected

Thanks.

EU
 
T

Tod

You can do something like this:

'Code for command button click event
Private Sub CommandButton1_Click()
Set FindIt = ActiveSheet.Range("A1:A" &
ActiveSheet.Range("A65536").End(xlUp).Row).Find(Trim
(ActiveSheet.Range("D1").Value))
If Not FindIt Is Nothing Then ActiveSheet.Range
(FindIt.Address).Select

End Sub

tod
 

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