Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default % Change calculation

You can change the RowAbsolute and ColumnAbsolute values of the Address eg:

Sub Variance1()
Dim actual As Range
Dim std As Range
Dim exptype As String

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

On Error Resume Next

Set actual = Application.InputBox( _
prompt:="Select cell for Actual data.", Type:=8)

Set std = Application.InputBox( _
prompt:="Select cell for Standard data.", Type:=8)

On Error GoTo 0

If Not actual Is Nothing And Not std Is Nothing Then

If exptype = "e" Then
ActiveCell.Formula = "=-(" & actual.Address(0, 0) _
& "/" & std.Address(0, 0) & "-1)"
Else
ActiveCell.Formula = "=" & actual.Address(0, 0) & _
"/" & std.Address(0, 0) & "-1"
End If

End If

Selection.Style = "Percent"

End Sub

Regards
Rowan

al wrote:
Thxs a lot - what should I amend to get a relative formula instead of
an absolute formula as is the case
thxs

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple calculation where values change to letters? Zuo Excel Worksheet Functions 3 May 3rd 10 11:48 PM
Calculation options change arbitrarily Alex Mackenzie Excel Worksheet Functions 1 July 7th 09 02:38 PM
the calculation tab being changed and you didn't change it? Sandra M. Excel Discussion (Misc queries) 4 January 20th 07 02:21 AM
why does the calculation summery not change calculation summery does not change Excel Discussion (Misc queries) 3 May 9th 06 06:43 AM
How do I make the now() static and not change with calculation? Helping with time Excel Worksheet Functions 2 February 12th 06 06:20 PM


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"