% variance calculation - amended

  • Thread starter Thread starter al
  • Start date Start date
A

al

Sub Macro2()

Dim exptype

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

If exptype = "e" Then


ActiveCell.FormulaR1C1 = "=-(RC[-1]/RC[-2]-1)"

Else


ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-2]-1)"

End If
End Sub


Pls help - why i'm not getting any result if exptype is not equal to e

thxs
 
Check the formula you have when exptype is not e. Is it syntactically
correct? Specifically, check the parenthesis use.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top