I'm trying to use the same basic SUM formula down an entire column...
Column D will always be the SUM formula column, but the formula will change to:
ActiveSheet.Range("D3").Formula = "=SUM(A3,B3,C3)"
ActiveSheet.Range("D4").Formula = "=SUM(A4,B4,C4)"
ActiveSheet.Range("D5").Formula = "=SUM(A5,B5,C5)"
ActiveSheet.Range("D6").Formula = "=SUM(A6,B6,C6)"
etc.
Blank rows are included in the spreadsheet and I'd like to be able stop including the SUM formula on the last row with data. Is there an easy way to write this in VBA without having to code in every range?
Code:
ActiveSheet.Range("D2").Formula = "=SUM(A2,B2,C2)"
Column D will always be the SUM formula column, but the formula will change to:
ActiveSheet.Range("D3").Formula = "=SUM(A3,B3,C3)"
ActiveSheet.Range("D4").Formula = "=SUM(A4,B4,C4)"
ActiveSheet.Range("D5").Formula = "=SUM(A5,B5,C5)"
ActiveSheet.Range("D6").Formula = "=SUM(A6,B6,C6)"
etc.
Blank rows are included in the spreadsheet and I'd like to be able stop including the SUM formula on the last row with data. Is there an easy way to write this in VBA without having to code in every range?