Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default How to obtain cell address of a succesful VLookup?

2003/2007

If the following is successful:

=VLOOKUP(J68,'1000'!$J$139:$J$150,1,FALSE)

How can I easily ID the found cell reference to use in subsequent VBA?

TIA EagleOne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default How to obtain cell address of a succesful VLookup?

On 27 Jun, 17:13, wrote:
2003/2007

If the following is successful:

=VLOOKUP(J68,'1000'!$J$139:$J$150,1,FALSE)

How can I easily ID the found cell reference to use in subsequent VBA?

TIA EagleOne


Not sure why you want to, but MATCH would do it

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default How to obtain cell address of a succesful VLookup?

I believe I found a clue. Need to prove it.

TIA

Address(match(J68,'1000'!$J$139:$J$150,0),1)



wrote:

cell address of a succesful VLookup

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to obtain cell address of a succesful VLookup?

Dim res as Variant, rng as Range
res = Application.Match(Range("J68").Value, _
Worksheets("1000").Range("J139:J150"),0)
if not iserror(res) then
set rng = Worksheets("1000").Range("J139:J150")(res)
else
set rng = Nothing
end if

--
Regards,
Tom Ogilvy


=VLOOKUP(J68,'1000'!$J$139:$J$150,1,FALSE)


" wrote:

2003/2007

If the following is successful:

=VLOOKUP(J68,'1000'!$J$139:$J$150,1,FALSE)

How can I easily ID the found cell reference to use in subsequent VBA?

TIA EagleOne

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default How to obtain cell address of a succesful VLookup?

Thanks Aiden and especially, Tom


Tom Ogilvy wrote:

Dim res as Variant, rng as Range
res = Application.Match(Range("J68").Value, _
Worksheets("1000").Range("J139:J150"),0)
if not iserror(res) then
set rng = Worksheets("1000").Range("J139:J150")(res)
else
set rng = Nothing
end if



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to obtain cell address of a succesful VLookup?

Everything you show are worksheet implementations. Not VBA.

It is unclear what you are asking.

--
Regards,
Tom Ogilvy



" wrote:

I believe I found a clue. Need to prove it.

TIA

Address(match(J68,'1000'!$J$139:$J$150,0),1)



wrote:

cell address of a succesful VLookup


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default How to obtain cell address of a succesful VLookup?

Good point.

What I need is either VBA variable [or in the activecell.Offset(,1)] the actual w/s cell reference
which contains the match (previously VLookup)

Using Address(Match( ......)) I get the relative Address i.e. "A1" which is actually "J139" of w/s
1000

Tom Ogilvy wrote:

Everything you show are worksheet implementations. Not VBA.

It is unclear what you are asking.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to obtain cell address of a succesful VLookup?

My code gives you that.

Dim res as Variant, rng as Range
res = Application.Match(Range("J68").Value, _
Worksheets("1000").Range("J139:J150"),0)
if not iserror(res) then
set rng = Worksheets("1000").Range("J139:J150")(res)
else
set rng = Nothing
end if
if not rng is nothing then
msgbox "Match made at " & rng.Address
else
msgbox "No match made"
End if

Will give you some visual stimulation.

--
Regards,
Tom Ogilvy


" wrote:

Good point.

What I need is either VBA variable [or in the activecell.Offset(,1)] the actual w/s cell reference
which contains the match (previously VLookup)

Using Address(Match( ......)) I get the relative Address i.e. "A1" which is actually "J139" of w/s
1000

Tom Ogilvy wrote:

Everything you show are worksheet implementations. Not VBA.

It is unclear what you are asking.


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default How to obtain cell address of a succesful VLookup?

Zing; Pop; Bang; it is the 4th of July!

Tom Ogilvy wrote:

My code gives you that.

Dim res as Variant, rng as Range
res = Application.Match(Range("J68").Value, _
Worksheets("1000").Range("J139:J150"),0)
if not iserror(res) then
set rng = Worksheets("1000").Range("J139:J150")(res)
else
set rng = Nothing
end if
if not rng is nothing then
msgbox "Match made at " & rng.Address
else
msgbox "No match made"
End if

Will give you some visual stimulation.

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
vlookup to obtain pictures Rosebud Excel Discussion (Misc queries) 1 May 18th 07 08:38 AM
Using vlookup - how can I obtain a sum of values, not just first v Terri Excel Worksheet Functions 1 June 12th 06 05:52 PM
Cell address from Vlookup Harry Excel Programming 2 July 11th 05 02:45 PM
How do I obtain the address of a cell using the vlookup function? Spock Excel Worksheet Functions 2 May 16th 05 06:35 PM
Would like to Obtain a Cell Address from a vlookup function CR_2004_04_08 Excel Programming 3 April 9th 04 11:12 AM


All times are GMT +1. The time now is 11:52 PM.

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

About Us

"It's about Microsoft Excel"