Skip to content

Commit

Permalink
Fixing reference cell for the formula of 'finalSum' sub
Browse files Browse the repository at this point in the history
  • Loading branch information
QaruzDin committed Sep 25, 2024
1 parent 1dd1525 commit 65602c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DelCellAutomationV1.bas
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Sub finalSum()

Set sumcells = Range("A1").Offset(3, 0).End(xlDown).Offset(1, 2)
With sumcells
.Formula = "=SUM(" & Range(Range("A1").Offset(1, 2), sumcells.Offset(-1, 0)).Address & ")"
.Formula = "=SUM(" & Range(sumcells.Offset(-1, 0).End(xlUp).Offset(1, 0), sumcells.Offset(-1, 0)).Address & ")"
.Offset(-1, 0).Copy
.PasteSpecial Paste:=xlPasteFormats
.Offset(0, -1).Value = "Total"
Expand Down

0 comments on commit 65602c1

Please sign in to comment.