halogen_bulb
New member
- Local time
- Today, 11:07
- Joined
- Nov 15, 2011
- Messages
- 2
Hi,
I was able to create a macro to sum up a range of every page but that was fixed only on specific numberof rows. The problem arises when size of the rows on every page vary and the result of the sum will not be the actual value of every page rather the sum up is overlapped or shortened. Sumif is better but during submission to our client, every page should come with a simple summation.
Here is the code I use.
I am attaching the sample of my worksheet. Im pretty sure there is a way to do it but I dont know how.
Please help.
Thanks,
I was able to create a macro to sum up a range of every page but that was fixed only on specific numberof rows. The problem arises when size of the rows on every page vary and the result of the sum will not be the actual value of every page rather the sum up is overlapped or shortened. Sumif is better but during submission to our client, every page should come with a simple summation.
Here is the code I use.
Code:
Sub sum()
'
' sum Macro
'
ActiveCell.FormulaR1C1 = "=SUM(R[-48]C:R[-1]C)"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End Sub


Thanks,
Last edited: