Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
match vlookup function Wanna Learn Excel Discussion (Misc queries) 4 May 18th 09 02:34 PM
Selecting a diff. worksheet but same cell references using Validat Ditch Excel Worksheet Functions 1 July 9th 08 09:24 AM
vlookup/ match or other function?? Claudia Excel Worksheet Functions 3 May 16th 07 05:23 PM
Match function selecting first value it matches on exactly Paul K. Excel Worksheet Functions 1 February 24th 05 08:57 PM
Using Cell references in VLookUp JonWilson631 Excel Worksheet Functions 1 November 4th 04 02:49 AM


All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"