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?
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?
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?
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?
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks