ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sum column with count formula (https://www.excelbanter.com/excel-programming/436687-sum-column-count-formula.html)

Wally

Sum column with count formula
 
With Worksheets("Orders")
LastRow = .Cells(Rows.Count, "J").End(xlUp).Row
End With
Range("J2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Activate
ActiveCell.Formula = "=Sum(J2:J" & LastRow&")"

How would I write the Formula for this cell?

TIA

Gerry

Wally

Sum column with count formula
 
On Nov 26, 3:28*pm, Wally wrote:
With Worksheets("Orders")
* * LastRow = .Cells(Rows.Count, "J").End(xlUp).Row
* * End With
* * Range("J2").Select
* * Selection.End(xlDown).Select
* * ActiveCell.Offset(1, 0).Activate
* * ActiveCell.Formula = "=Sum(J2:J" & LastRow&")"

How would I write the Formula for this cell?

TIA

Gerry


Ok, I got that one figured out.

I forgot to set Dim LastRow as String



All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com