PC Review


Reply
Thread Tools Rate Thread

Converting an array formula to VBA

 
 
=?Utf-8?B?UFYgSmVmZQ==?=
Guest
Posts: n/a
 
      10th Oct 2006
I understand ithat it is not possible to use an array formula in VBA using
the " .formula = " context. Can someone show me the steps, and/or the logic
for creating an array formula in VBA? I don't want these 30 array formulas
to stay in the worksheet, since I copy this sheet 60-120 times within a
workbook. Although (if possible) I could copy the formula in, paste the
values, and then delete the formulas, I would rather just pass the values to
the proper cells. The formula uses two criteria to find a value in a table
on a separate sheet within the workbook:

{=IF(ISERROR(INDEX(RETAIL,MATCH(Z7&T7,CONCAT&RETAIL,0))),INDEX(RETAIL,MATCH(Z7,CONCAT,0)),INDEX(RETAIL,MATCH(Z7&T7,CONCAT&RETAIL,0)))}

"RETAIL" is a range (one column) containing retail prices
"CONCAT" is another one column range in the same table which concatenates a
product code

The sheet that uses this formula (on 32 lines) is replicated 60-120 times
within the workbook, which slows everything down and creates bloat. I've
converted the rest of my formulas to VBA, but this one is hard for me to
understand. Any ideas would be greatly appreciated!
 
Reply With Quote
 
 
 
 
acampbell012@yahoo.com
Guest
Posts: n/a
 
      10th Oct 2006

YourRange.FormulaArray =

PV Jefe wrote:
> I understand ithat it is not possible to use an array formula in VBA using
> the " .formula = " context. Can someone show me the steps, and/or the logic
> for creating an array formula in VBA? I don't want these 30 array formulas
> to stay in the worksheet, since I copy this sheet 60-120 times within a
> workbook. Although (if possible) I could copy the formula in, paste the
> values, and then delete the formulas, I would rather just pass the values to
> the proper cells. The formula uses two criteria to find a value in a table
> on a separate sheet within the workbook:
>
> {=IF(ISERROR(INDEX(RETAIL,MATCH(Z7&T7,CONCAT&RETAIL,0))),INDEX(RETAIL,MATCH(Z7,CONCAT,0)),INDEX(RETAIL,MATCH(Z7&T7,CONCAT&RETAIL,0)))}
>
> "RETAIL" is a range (one column) containing retail prices
> "CONCAT" is another one column range in the same table which concatenates a
> product code
>
> The sheet that uses this formula (on 32 lines) is replicated 60-120 times
> within the workbook, which slows everything down and creates bloat. I've
> converted the rest of my formulas to VBA, but this one is hard for me to
> understand. Any ideas would be greatly appreciated!


 
Reply With Quote
 
=?Utf-8?B?UFYgSmVmZQ==?=
Guest
Posts: n/a
 
      10th Oct 2006
Muchas Gracias!! That was toooo easy! I think I tend to overcomplicate
things!!

"(E-Mail Removed)" wrote:

>
> YourRange.FormulaArray =
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem converting managed array (C++) to C# array Dick Swager Microsoft VC .NET 2 30th Aug 2005 02:53 AM
Tricky array formula issue - Using array formula on one cell, then autofilling down a range aspenbordr Microsoft Excel Programming 0 27th Jul 2005 03:59 PM
Converting array formula to work with datatables/dataset tia sal sal Microsoft VB .NET 4 30th Nov 2004 03:00 PM
Converting array formula to work with datatables/dataset tia sal sal Microsoft ADO .NET 0 30th Nov 2004 03:43 AM
converting an array of bytes to an array of chars Claire Microsoft C# .NET 1 8th Jun 2004 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.