using a go to the last row in a formula

  • Thread starter Thread starter mike.wilson8
  • Start date Start date
M

mike.wilson8

A couple of days ago, somone was able to help me count the number of
unique records + only count the value if it starts with "AM".

See below.

=SUMPRODUCT(SUBTOTAL(3,OFFSET(U2:U999,ROW(U2:U999)-ROW(U2),0,1)),--(U2:U999="AM"))

Now my next task is to see if the formula above can be tweaked, where
U2:U999 isn't predefined, but instead start on row U2 and go to the
last available row in column U.

Any feedback on this would be great.

Thanks,
Mike
 
Hi Mike,

Hope this helps.

Sub LastRow()
Dim LastRow As Integer
LastRow = Application.CountA(ActiveSheet.Range("A:A")) + 1
Cells(LastRow, 1).Select
End Sub

Just get rid of +1 to select the last row.
 

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

Back
Top