LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Use VBA to get values from named range that contains an array formula expression

Hi James,

It's not clear what you are doing, eg have you created a named range or a
named formula or both, how are you using Index, etc.

I did the following -

Created two dynamic named ranges KnownX & KnownY to refer to cells in
columns A & B

Created a named formula
"nmLinest" refersto: =LINEST(KnownY, KnownX^{1,2})

I entered some X's in col-A, FWIW 1, 2 & 3
For Y's, in B1: =A1^2*2+A1*3+5
and filled down

In VBA -

arr = Evaluate("nmLinest")

For i = 1 To UBound(arr) ' to 3
Debug.Print Application.Index(arr, i)
Next

1.99999999999999
3.00000000000004
4.99999999999997

A tad of rounding would return correct results of 2, 3 & 5 in this contrived
example.

Regards,
Peter T

wrote in message
...
I've used an array formula (linest, as a test) to create an array
formula in an named range by typing the array formula into the Refers
to box on the Define Name pop-up window.

By entering the Index worksheet function in a worksheet cell, I can
access the values in the linest result 'array' but I can't figure out
how to access the values in VBA.

Surely someone has done this, but my best thinking and a lot of
internet searches haven't turned up an answer.

Thanks in advance, even if the answer turns out to be "You can't do
that!" :)

James



 
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
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
Named range in an array Frigster Excel Programming 5 September 8th 06 10:34 PM
Named range into an array Frigster Excel Worksheet Functions 2 September 6th 06 07:08 PM
Named Range to Array Oddity bloycee Excel Programming 6 December 7th 04 03:57 PM
Defined named range to array MattShoreson[_2_] Excel Programming 1 December 4th 03 10:06 AM


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