title: How do you find the last row number in column VBA?
body: <p>I am trying to find the last row number in a column in a specific VBA Excel sheet. The row number needs to be put into a var for later use. Thanks in advance!</p>
  
  <pre><code>Dim i As Integer
  Dim x As Integer
  Dim lRow As Integer
  Dim subj As String
  
  subj = TextBox1.Text
  lRow = ThisWorkbook.Sheets("Data").Range("A").Rows.Lastrow
  
  ThisWorkbook.Sheets("Data").Cells(lRow, 1) = subj
  
  For i = 1 To 1000
  
      If ThisWorkbook.Sheets("Data").Cells(1, i) = ThisWorkbook.Sheets(subj).Cells(1, 1) Then
  
      End If
  
  Next i
  </code></pre>