slamet Harto
04-29-2009, 10:06 PM
guys,
can you advise why the following formula doesn't work.
I want to sum (let say H10 to H15) then devide by 100.
Thanks for support
Public Sub SumACycle()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim lastrow As Long
With ActiveSheet
lastrow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).row
.Cells(lastrow + 1, "A").Value = "TOTAL"
.Cells(lastrow + 1, "H").Formula = "=SUM(H10:H" & lastrow & ")" /100
.Cells(lastrow + 1, "I").Formula = "=SUM(I10:I" & lastrow & ")" /100
End With
End sub
can you advise why the following formula doesn't work.
I want to sum (let say H10 to H15) then devide by 100.
Thanks for support
Public Sub SumACycle()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim lastrow As Long
With ActiveSheet
lastrow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).row
.Cells(lastrow + 1, "A").Value = "TOTAL"
.Cells(lastrow + 1, "H").Formula = "=SUM(H10:H" & lastrow & ")" /100
.Cells(lastrow + 1, "I").Formula = "=SUM(I10:I" & lastrow & ")" /100
End With
End sub