Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
leo leo is offline
external usenet poster
 
Posts: 74
Default Passing Array Formula result to a variable in VBA (Leo)

Hi,
We know that for putting an arrya formula we use "Range.formulaArray"
property.
But what about if I need to use an array formula result in the context of my
code (like myVar =workbook.formula) and passing it to my variable, without
putting it on a cell: just like MyVar or myFunction = arrayformula(sth).
Is there any way?
please help.
--
Thans & Best regards
Leo, InfoSeeker
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Passing Array Formula result to a variable in VBA (Leo)

myVar = Activesheet.Evaluate(the_array_formula)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Leo" wrote in message
...
Hi,
We know that for putting an arrya formula we use "Range.formulaArray"
property.
But what about if I need to use an array formula result in the context of
my
code (like myVar =workbook.formula) and passing it to my variable, without
putting it on a cell: just like MyVar or myFunction = arrayformula(sth).
Is there any way?
please help.
--
Thans & Best regards
Leo, InfoSeeker



  #3   Report Post  
Posted to microsoft.public.excel.programming
leo leo is offline
external usenet poster
 
Posts: 74
Default Passing Array Formula result to a variable in VBA (Leo)

thank you so much for your reply, it did great help!
after a 2 or 3 times of error I managed to run this code with no error;
Public Sub MySub()
Dim myVar As Long
myVar =
Application.Evaluate("=SUM(IF((Sheet1!$A$2:$A$2000 =""P07"")*(Sheet1!$H$2:$H$2000=200707),Sheet1!$U$2 :$U$2000,0))")
Debug.Print myVar
End Sub

the point was that it should be used withouth the symbol "{}"
--
Thans & Best regards
Leo, InfoSeeker


"Bob Phillips" wrote:

myVar = Activesheet.Evaluate(the_array_formula)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Leo" wrote in message
...
Hi,
We know that for putting an arrya formula we use "Range.formulaArray"
property.
But what about if I need to use an array formula result in the context of
my
code (like myVar =workbook.formula) and passing it to my variable, without
putting it on a cell: just like MyVar or myFunction = arrayformula(sth).
Is there any way?
please help.
--
Thans & Best regards
Leo, InfoSeeker




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
Hide #VALUE! in result of array formula Ron Weaver Excel Worksheet Functions 6 January 29th 07 10:46 PM
Passing string as array variable (Pivot VBA) klingongardener Excel Discussion (Misc queries) 2 December 23rd 06 07:58 PM
Passing formula value to variable, hide rows Punsterr Excel Programming 1 June 9th 06 01:34 AM
keep recursion result (a dynamic array) without using global variable lvcha.gouqizi Excel Programming 4 October 25th 05 07:06 PM
Passing SQL Query Result Into A Variable Elliot[_2_] Excel Programming 4 January 9th 04 09:55 AM


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