asked on
Sub possibleSolution()
'The following will put your sum formula in the next available cell in column D.
'declare a string variable to hold your formula
Dim formulaString As String
'populate formulaString with formula
formulaString = "=sum(d2:d" & Range("d" & Rows.Count).End(xlUp).Row - 1 & ")"
Debug.Print Now & formulaString
'put the formula in the next available cell in column d
Range("d" & Rows.Count).End(xlUp).Formula = formulaString
End Sub
ASKER
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.
TRUSTED BY
Are you trying to put your sum formula in every used cell in column D? Or are you simply summing the values in column D?