Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Assign formula array in vba

Hello, I loop thru my datasheet where each row's columns A,B and C have to
lookup a unique match of columns A,B and C in another workbook called "Z"
within a sheet named "Detail". For each match, I need to place the value from
cell F in the other worksheet into cell H of my datasheet. I do this by
using the following code within a loop . The error (UNABLE TO SET THE FORMULA
ARRAY PROPERTY OF THE RANGE CLASS) happens if I try to substitute a value for
the varable- valueLook(datatype Variant) such as valueLook = "AlphaBetaGamma"
instead of using cell addresses.

THIS WORKS BUT I CAN'T SUBSTITUTE A VALUE "AlphaBetaGamma" FOR VARIABLE
valueLook

valueLook = ActiveCell.Address & "&" & ActiveCell.Offset(0, 1).Address & _
"&" & ActiveCell.Offset(0, 2).Address

I USE THIS VARIABLE IN THE FOLLOWING FORMULA

Range(ActiveCell.Offset(0, 7).Address).FormulaArray =
"=INDEX('[Z.xls]Detail'!$F$4:$F$600,MATCH(" & valueLook &
",'[Z.xls]Detail'!$A$4:$A$500
&'[Z.xls]Detail'!$B$4:$B$500&'[Z.xls]Detail'!$C$4:$C$500,0))"

The basis of my question is how to assign manual values instead of cell
addresses for my lookup in FormulaArrays using the INDEX/MATCH combination
within VBA.
valueLook = "abc"
in the above code would generate the error
Thanks.


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
Assign Values to array Jeff Excel Discussion (Misc queries) 14 July 15th 08 06:06 PM
Can't assign to Array .GetRows in Excel 97 Lenn Excel Programming 2 June 24th 04 02:30 AM
How do I assign values to an array? Skyway[_2_] Excel Programming 14 February 29th 04 01:22 AM
Possible to assign an array to a SeriesCollection Stephen Boulet Excel Programming 2 November 13th 03 06:36 PM
how to assign ranges on different sheets to an array KRCowen Excel Programming 0 July 22nd 03 02:46 AM


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