View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default variable in a formula

jobra,

ActiveCell.FormulaR1C1 = _
"=IF(ISBLANK(R[" & teller & "]C[-5]),"""",(RC[-4]+(-1*RC[-3])))"

HTH,
Bernie
MS Excel MVP


"jobra" wrote in message
...
How can I use a variable in a formula as shown below?

dim teller as integer
(sample)
teller = 6
ActiveCell.FormulaR1C1 = _
"=IF(ISBLANK(R[teller]C[-5]),"""",(RC[-4]+(-1*RC[-3]))

this seems not to work can anyone help me?
Thank you very much