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: 1
Default find each of the items in an array and save result in another array


Hi,

There must be an easy solution to this.

I am working with an array of values and need to look up each value in
a worksheet and store the value of a cell 3 columns away in another
array.

Now the following code works for single variable

Dim Pre as string
With Worksheets("Pre_Rawdata").Range("h2:p8")

Pre = .Find(What:="13", After:=.Cells(1, 1), _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows,
_
SearchDirection:=xlNext, MatchCase:=False).Offset(0, 3)
End With

but I actually need to do the same thing but where pre is an array and
the What:= term is an array.

like this


Dim Pre(1 to 25) as string
Dim precondtition(1 to 25) as string

For i = 1 To 25
With Worksheets("Pre_Rawdata").Range("h2:p8")
Pre(i) = .Find(What:=precondition(i), After:=.Cells(1, 1), _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows,
_
SearchDirection:=xlNext, MatchCase:=False).Offset(0, 3)
End With
next

I get "Object variable or with block variable not set"

How can I find all the members of an array in a range and store the
results in another array???

Thanks for any help,
Luis


--
lif
------------------------------------------------------------------------
lif's Profile: http://www.excelforum.com/member.php...o&userid=35745
View this thread: http://www.excelforum.com/showthread...hreadid=555836

 
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
How to find a result in an array in the same row as a minimum resu dbasmb Excel Discussion (Misc queries) 3 May 6th 10 12:39 AM
Find specific value in array of array formula DzednConfsd Excel Worksheet Functions 2 January 13th 09 06:19 AM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Use FIND to return an array of items quartz[_2_] Excel Programming 4 April 7th 05 10:09 PM
Alphabetizing array items No Name Excel Programming 2 March 25th 05 09:22 PM


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