Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default variable name based on calculated info & iteration formula

Hi,
I'm writing a formula that will automate excels goal seek
functionality. That is, I want to type a formula =iterate(C2, 25.2),
which will return a value in the called cell, so that the value in C2
gets closer to 25.2. The calculation option will be set to iterate,
so that the sheet continues to calculate until some convergence
parameter is met.

In order to do this I need to declare several static variables or
names to store the past values of the calling cell, C2, and a
convergence parameter. Because this function could be called from
many cells in the same worksheet, the variable names need to be
different for each cell that it is called from.

So, I need to be able to do something like this:
stringName = "hello" & "world"
static [stringName] as single
helloworld = 5#

and then have the variable helloworld hold the value indefinitely

Alternatively, If I could do
Names.Add Name:=strName RefersTo:=3#
Names(strName).Value = 5#

And then be able to recall the value as Names(strName).Value, that
would work.
I have not been able to do either of these successfully.
If anyone could suggest a workaround, or the correct syntax for either
of these methods (I don't think they can be used though), that would
be very helpful.
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
Formula based on variable range BruceM via OfficeKB.com Excel Worksheet Functions 3 November 17th 09 07:45 PM
I want to create a calculated item based on a calculated field Stijn Excel Discussion (Misc queries) 1 August 25th 08 05:30 PM
question about formula based on another workbook info Treesy Excel Discussion (Misc queries) 6 February 17th 06 08:11 PM
Formula to Autofill Info based on Other Data SamanthaM Excel Discussion (Misc queries) 1 October 5th 05 08:55 PM
How to create a calculated field formula based on Pivot Table resu dha17 Excel Discussion (Misc queries) 1 December 15th 04 05:39 AM


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