or this one:

Function FindX(RangeX As Range, ValueX As String)
'Row Number
FindX = RangeX.Find(What:=ValueX).Row
End Function
 

_________________________________________________________________________________________________
"There are known knowns. These are things we know that we know. There are known 
unknowns. That is to say, there are things that we know we don't know. But 
there are also unknown unknowns. There are things we don't know we don't know." 




________________________________
From: Tom Jeffries <tjeff...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Wednesday, 24 December, 2008 5:29:11 AM
Subject: $$Excel-Macros$$ Re: How do I create formula to return row number of 
search result...


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.






      Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/
--~--~---------~--~----~------------~-------~--~----~
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