LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Application.Match on 2D array - syntax problem?

I googled, but didn't find any good hits that addressed this.

I have a 2-D array that is populated by combining unique records from two
different workbooks. I then have to use a value in the first column
(MyArray(X,1)) and use that to find a matching value in a different 2-D
array, pulled in from a different workbook ("RawArray"); once I know what
"row" the match is in, I will pull a value from the 5th "column" of RawArray.
I tried using application.match, but it keeps returning an error 2042. I've
manually confirmed that the value exists (correcting for one being text, the
other being a number), but it still isn't getting a match. I'm starting to
suspect that it is my syntax, or somehow related to how I load the "RawArray"
[in the code below] by using RawArray = mywrksht.Range("A2:AK5000").Value,
since it returns the values as RawArray(rows, columns) but I'm not clear on
whether that is really the problem, or how to fix it.

I appreciate any help,
Keith

Dataset 1 (expressed as a worksheet layout)

Header1 (Header2 Header 3, etc.)
ID101
ID102
ID103

Dataset2
Header1 H2 H3 H4 H5 (H6, etc)
ID412 abc
ID921 def
ID101 ghi

So basically, I am cycling the first list, and for each one pulling in the
corresponding value under header5, in this first case, ID101- ghi

Here is the actual code (sorry for the linewrap, I am using the MS web
interface, ugh):
For CheckC = 2 To LastPro
'changing the numeric value to a string, because it is a string in the
other array
TempID = ProArray(CheckC, 1) & ""
'try to find the matching value
TempIDRow = Application.Match(TempID, RawArray, False)
If IsError(TempIDRow) Then MsgBox "There is still a problem"
Next



 
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
Application.Match on an range defined to a variant array Keith R[_2_] Excel Programming 5 November 12th 07 10:37 PM
application.match with multi-dimensional arrays (syntax request) Keith R Excel Programming 4 June 28th 07 09:37 PM
application.match and multidimensional array? KR Excel Programming 2 March 13th 06 05:20 PM
check value with array, Application.Match Przemek Excel Programming 5 August 25th 05 12:09 PM
Using Application.match against one dimension of a multidimensional array? KR Excel Programming 1 January 24th 05 10:01 PM


All times are GMT +1. The time now is 02:25 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"