The following should help you.  If you have any questions let me know

Sub FindIt()
    Dim What As String

    What = InputBox(" Enter a search string ", "Search String")
    Set Found = ActiveSheet.UsedRange.Find(What)

    If Not Found Is Nothing Then
        r = Cells.Find(What).Row
        MsgBox "Target found in row " & r
    Else
        MsgBox "Target was not found"
    End If
End Sub

Regards,
Tom

On Thu, Dec 18, 2008 at 12:02 PM, ShellyGirl <shellywilloug...@yahoo.com>wrote:

>
> Hello, I am trying to create a macro.  I would like for user to be
> able to type in a search criteria and hit search button.  I would like
> the macro to search a range of cells for the input and return the row
> number of the first search result.  Any help will be greatly
> appreciated...
>
> I think my main problem is, I don't know how to create a formula to
> return a row number.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Visit the blog to download Excel tutorials at 
http://www.excel-macros.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/excel-macros?hl=en

Visit & Join Our Orkut Community at 
http://www.orkut.com/Community.aspx?cmm=22913620

Visit the blog to download Excel tutorials at 
http://www.excel-macros.blogspot.com

To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com

To see the Daily Excel Tips, Go to:
http://exceldailytip.blogspot.com
-~----------~----~----~----~------~----~------~--~---

Reply via email to