Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Application.WorksheetFunction.Match

Is it possible to use a value from one spreadsheet as the lookup value
and the range from another spreadsheet as the range argument? If so,
what would the syntax be?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Application.WorksheetFunction.Match

Both workbooks are open?

dim myLookup as range
dim myLookupRng as range
dim res as variant

set mylookup = workbooks("book1.xls").worksheets("sheet1").range( "a1")
set mylookuprng = workbooks("book2.xls").worksheets("sheet99").range ("a1:A99")

res = application.match(mylookup.value, mylookuprng,0)

if iserror(res) then
msgbox "not found"
else
msgbox "Found on row: " & res
end if

is one way.


TK wrote:

Is it possible to use a value from one spreadsheet as the lookup value
and the range from another spreadsheet as the range argument? If so,
what would the syntax be?

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Application.WorksheetFunction.Match

Dave Peterson wrote:
Both workbooks are open?

dim myLookup as range
dim myLookupRng as range
dim res as variant

set mylookup = workbooks("book1.xls").worksheets("sheet1").range( "a1")
set mylookuprng = workbooks("book2.xls").worksheets("sheet99").range ("a1:A99")

res = application.match(mylookup.value, mylookuprng,0)

if iserror(res) then
msgbox "not found"
else
msgbox "Found on row: " & res
end if

is one way.


TK wrote:

Is it possible to use a value from one spreadsheet as the lookup value
and the range from another spreadsheet as the range argument? If so,
what would the syntax be?

Thanks



Works great. Thanks a lot!
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
Need help with Application.WorksheetFunction Ayo Excel Discussion (Misc queries) 4 May 14th 08 11:13 PM
Application.WorksheetFunction.Match problem Carl Brehm Excel Worksheet Functions 1 January 9th 05 02:08 PM
Application.worksheetfunction Terry V Excel Programming 7 October 12th 04 05:48 AM
application.worksheetfunction.vlookup JulieD Excel Programming 5 August 12th 04 04:42 PM
Using Application.WorksheetFunction.Ln(...) in VBA doco Excel Programming 4 August 25th 03 01:08 PM


All times are GMT +1. The time now is 11:24 AM.

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"