LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Newbie in deep..... Excel and VB

Hi everyone.
I'm an experienced programmer, just not experienced with Excel and VB. I have
to populate a spread sheet programmatically. On a button click, I am clearing
the worksheet, and then I compute a formula that goes into each cell. It
doesn't work!

This is what I'm doing (snipped somewhat)

Dim myFormula as string

....

myFormula = "=A1+B1"
cells(10, 10).formula = myFormula

..... that works.

So does.... cells(10,10).formula = "A1+B1"

Now if I need to compute the formula at runtime like this....
Let x=1
Let y=1
myFormula = "=A"+str(x)+"+B"+str(y)
and try cells(10, 10).formula = myFormula I get an error.

In each case the value of myFormula is "=A1+B1"

Anybody ever tried dynamically computing a formula and assigning it to a cell?

I've been working on XL for the past week, and have been very impressed with
the capabilities, but before I can become a true believer I need to know how to
do this...

Similarly, how can I dynamically compute a range? I would like to pass a
computed string to a statement like this:

range(mycomputedstring).formula = myFormula

Thanks in advance for your help.

Brad Vernon
Help!
 
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
Summing values, x rows deep, depending on a criterion klm[_2_] Excel Worksheet Functions 2 August 18th 08 02:02 PM
path too deep bothan25 Excel Discussion (Misc queries) 1 July 30th 08 11:44 PM
Why can't I have a cell more than 1 line deep? Conservative Officer New Users to Excel 2 July 18th 08 08:49 AM
3 deep nested if gets the same value on every cell. Janis Excel Discussion (Misc queries) 1 July 30th 07 09:10 PM
too deep formula line Light Excel Discussion (Misc queries) 5 March 17th 06 07:16 PM


All times are GMT +1. The time now is 07:49 AM.

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"