Sum column with count formula

W

Wally

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
 
W

Wally

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top