View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 64
Default % variance calculation

Can anybody help me to correct this macro:


Sub Macro1()

Dim exptype

exptype = InputBox("Enter e if expense type.")

ActiveCell.FormulaR1C1 =
"=IF(exptype=""e"",-(RC[-1]/RC[-2]-1),RC[-1]/RC[-2]-1)"

End Sub

Am getting error #NAME?

I do not want to refer exptype to any cell as it's only a general input

Thxs