Closed Thread
Results 1 to 4 of 4

selecting the cell that a vlookup or match function references

  1. #1
    Elceller in distress
    Guest

    selecting the cell that a vlookup or match function references

    I would like to use vlookup or match to find a record in a database. Once
    vlookup or match finds it, I would like to select the whole row. Is this
    possible?

  2. #2
    Jim Thomlinson
    Guest

    RE: selecting the cell that a vlookup or match function references

    You can give this a try... It searches all of the cells on a sheet. We can
    narrow that down to a column or such if you need...

    Sub FindRow()
    Dim rngFound As Range

    Set rngFound = Cells.Find(What:="This", _
    LookIn:=xlFormulas, _
    LookAt:=xlPart, _
    MatchCase:=False)
    If rngFound Is Nothing Then
    MsgBox "Sorry ""This"" was not found"
    Else
    rngFound.EntireRow.Select
    End If
    End Sub
    --
    HTH...

    Jim Thomlinson


    "Elceller in distress" wrote:

    > I would like to use vlookup or match to find a record in a database. Once
    > vlookup or match finds it, I would like to select the whole row. Is this
    > possible?


  3. #3
    Elceller in distress
    Guest

    RE: selecting the cell that a vlookup or match function reference

    Can I make it just search in one colum and then select the row of the search
    result. In other words, I only want it to find matches in colum L, then
    select the entire row associated with that key word.

    "Jim Thomlinson" wrote:

    > You can give this a try... It searches all of the cells on a sheet. We can
    > narrow that down to a column or such if you need...
    >
    > Sub FindRow()
    > Dim rngFound As Range
    >
    > Set rngFound = Cells.Find(What:="This", _
    > LookIn:=xlFormulas, _
    > LookAt:=xlPart, _
    > MatchCase:=False)
    > If rngFound Is Nothing Then
    > MsgBox "Sorry ""This"" was not found"
    > Else
    > rngFound.EntireRow.Select
    > End If
    > End Sub
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Elceller in distress" wrote:
    >
    > > I would like to use vlookup or match to find a record in a database. Once
    > > vlookup or match finds it, I would like to select the whole row. Is this
    > > possible?


  4. #4
    Dave Peterson
    Guest

    Re: selecting the cell that a vlookup or match function reference

    Something like:

    Sub FindRow()
    Dim rngFound As Range

    Set rngFound = range("L:L").Cells.Find(What:="This", _
    LookIn:=xlFormulas, _
    LookAt:=xlPart, _
    MatchCase:=False)
    If rngFound Is Nothing Then
    MsgBox "Sorry ""This"" was not found"
    Else
    rngFound.EntireRow.Select
    End If
    End Sub

    But the code already selects the whole row where it was found.



    Elceller in distress wrote:
    >
    > Can I make it just search in one colum and then select the row of the search
    > result. In other words, I only want it to find matches in colum L, then
    > select the entire row associated with that key word.
    >
    > "Jim Thomlinson" wrote:
    >
    > > You can give this a try... It searches all of the cells on a sheet. We can
    > > narrow that down to a column or such if you need...
    > >
    > > Sub FindRow()
    > > Dim rngFound As Range
    > >
    > > Set rngFound = Cells.Find(What:="This", _
    > > LookIn:=xlFormulas, _
    > > LookAt:=xlPart, _
    > > MatchCase:=False)
    > > If rngFound Is Nothing Then
    > > MsgBox "Sorry ""This"" was not found"
    > > Else
    > > rngFound.EntireRow.Select
    > > End If
    > > End Sub
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "Elceller in distress" wrote:
    > >
    > > > I would like to use vlookup or match to find a record in a database. Once
    > > > vlookup or match finds it, I would like to select the whole row. Is this
    > > > possible?


    --

    Dave Peterson

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1