View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default Using variables in RCs

Try:

"=IF((RC[-" & j & "]+...."

etc.

--

Vasant




"Mike D." wrote in message
...
Hi. I would like to have the following formula contain a variable if
possible. For instance, instead of having "RC[-10]", I would like to have
"RC[-j]" where "j" is a variable. Is there a way to do this?

ActiveCell.FormulaR1C1 =
"=IF((RC[-10]+RC[-4])0,RC[-10]/(RC[-10]+RC[-4]),na())"

Thanks,
Mike.