MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Macro stuff


Posted by George Tikai on October 31, 2001 7:42 AM

Hey all,

I'm trying to create an excel macro that opens up a find window. Any idea how this might be done?

Thanks in advance,

George


Posted by EDDIE G on October 31, 2001 8:13 AM

Here is a great macro that uses an input box to find whatever in column B..you can modify to your liking...........


Sub NAMEFINDER()
Dim lookFor As Variant, rng As Range
showInputBox:
lookFor = Application.InputBox("Enter Last Name", "Search For Name")
If lookFor = False Then
Exit Sub
ElseIf lookFor = "" Then GoTo showInputBox
Else: Set rng = Worksheets("FAXGATE DIRECTORY").Columns(2).Find(lookFor)
If rng Is Nothing Then
MsgBox lookFor & " was not found. Click the NeverLost unit for another search."
Exit Sub
End If
MsgBox "The name you entered is in cell " & rng.Address(False, False) & ". Clicking OK will take you there."
rng.Select
End If
End Sub

Posted by George Tikai on November 01, 2001 5:21 AM

Thanks Eddie... happy spreadsheeting!

Here is a great macro that uses an input box to find whatever in column B..you can modify to your liking...........