variables in a formula statement


Posted by michael irizarry on January 11, 2001 11:56 AM

Im using a formula statement but i need to include a variable, I cant get the syntax right
help
looks like
ActiveCell.FormulaR1C1 = "=rc[-1]* variable"

Posted by Mark W. on January 11, 2001 11:59 AM

=rc[-1]" is the variable... do you mean a constant,
or perhaps a defined name?

Posted by michael irizarry on January 11, 2001 12:07 PM

i want to multiply rc[-1] by a difined name

Posted by Mark W. on January 11, 2001 12:12 PM

Does your code define it or is it preexistent?

Posted by Michael I on January 11, 2001 12:15 PM


it is defined


Posted by Mark W. on January 11, 2001 12:26 PM

It works fine for me...

1. I assigned the defined name, "variable", to
cell A1.
2. Enter {10,25} into cells A1:B1
3. Selected cell C1.
4. Ran the code which put the formula, =B1* variable,
in cell C1 which resulted in 250.



Posted by Michael I on January 11, 2001 12:47 PM

son of a..
thanks for your help
i simply forgot to use a dim and never
difined the variable, thanks for your help

mike