0

Here is my code:

Sub CommandButton1_Click()
  RowCount = Worksheets("Down Tracker").Cells(Rows.Count, 9).End(xlUp).Rows  
  MsgBox (RowCount)  
End Sub

The command button is in a worksheet called Sheet1 and it is pulling from a worksheet called Down Tracker. It is determining the last row of column I. Column I contains four digit codes in the format of either NLNN or LLNN (L = letter, N = number).

For some reason, this subroutine goes to the end cell and returns the value in the cell instead of returning the count.

I'm a VBA newbie. Any help would be appreciated

  • 2
    `.Rows` returns a `Range`. That range happens to be one cell in size, so its value is returned when it's used [in this context](https://stackoverflow.com/a/17877644/11683). Apparently you meant to show `.Row` which is the row number of that cell. – GSerg Apr 09 '18 at 20:02
  • That solved my problem. Thanks for the clarification. – Aaron Atkinson Apr 09 '18 at 20:07

0 Answers0