Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Jul 2001
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using Find and also receiving row location (Excel97 SR1)

    I have a User that wants to find a certain text (ex: director), but also wants to receive the location of the row the word is in.
    Expected result example: director Row 3, or director (c4).

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Find and also receiving row location (Excel97 SR1)

    Is this what you need?

    <pre>Dim strWhere As String, lRow As Long, oCell As Range
    Set oCell = ActiveSheet.Range("A:A").Find("director")
    If Not oCell Is Nothing Then
    strWhere = oCell.Address
    lRow = oCell.Row
    End If
    Set oCell = Nothing
    </pre>

    Legare Coleman

  3. #3
    Lounger
    Join Date
    Jul 2001
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Find and also receiving row location (Excel97 SR1)

    I tried it and have put together an example togehter, but not working correctly.
    Where would results end up?
    Attached Files Attached Files

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Find and also receiving row location (Excel97 SR1)

    My code put the cell address into a variable named strWhere, and the row number into a variable named lRow. If you want them on the spreadsheet somewhere, then you have to put it there. I have modified the code to put the cell address in cell E1, and the Row number in cell E2.
    Attached Files Attached Files
    Legare Coleman

  5. #5
    Lounger
    Join Date
    Jul 2001
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Find and also receiving row location (Excel97 SR1)

    Thanks for your help. That worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •