View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lt. Bonifacius Lt. Bonifacius is offline
external usenet poster
 
Posts: 5
Default Calculation With A Macro

Hi! Bob.
Try placing a Command Button some where in you worksheet, enter in Design
Mode and double clic teh Command Button. In Visual Basic code editor paste
the following code inside de command's button sub.

---------------------------------------------------------------------------------------------
'Variable declaration'
Dim VarRow As Integer
Dim VarSheetName As String

'Variable inicialization'
VarSheetName = Me.Name

'Loop' v501
For VarRow = 7 To 501
Me.Cells(VarRow, 22) = "=SUM(E" & VarRow & "/" & VarSheetName &
"!$D$26)*52"
Next
----------------------------------------------------------------------------------------------