View Single Post
 
Old 11-15-2011, 01:27 AM
halogen_bulb halogen_bulb is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Nov 2011
Posts: 2
halogen_bulb is on a distinguished road
Default Summation where range vary using Macro

Hi,

How do I improve this code by getting the summation of the same column with varying rows?

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
Im pretty sure there is a way to do it but I dont know how. Please help

Thanks,

Last edited by halogen_bulb; 11-15-2011 at 07:53 AM.
Reply With Quote