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

Can anybody help me with this macro:

Sub Variance1()

Dim exptype

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

Dim Actual
Actual = InputBox("Select cell for Actual data.")

Dim Std
Std = InputBox("Select cell for Standard data.")



If exptype = "e" Then

ActiveCell.Formula = "=-(Actual/Std-1)"

Else

ActiveCell.Formula = "=Actual/Std-1"

End If
Selection.Style = "Percent"
End Sub

I want Actual & Std to be the cell address of my selected cells
Am new to excel & not familiar with input box, specially cell addresses

Thxs
Al