title: Find First and Last Row Index after autofilter VBA
body: <p>Ive a sheet with more than 10000 rows of data. I need to filter it based on a date range in a column (Column F). But after filtering how can I find the Row index of first and last row in that Filtered data. Means First row index could be 120 and last row index could be 3200 something like that. What I tried is as follows to find the last row which is not working at all.</p>
  
  <pre><code>Public Sub clearExistingInvoice()
      Dim minDate As Date, maxDate As Date
      minDate = "10 FEB 2018" ' invoiceMinDate
      maxDate = "20 FEB 2018" 'invoiceMaxDate
      Dim minPosition As Integer
      Sheets("FullInvoice").UsedRange.AutoFilter
      Sheets("FullInvoice").UsedRange.AutoFilter Field:=6, Criteria1:="&gt;=" &amp; minDate, Criteria2:="&lt;=" &amp; maxDate
      Dim xRange As Range
      Dim lRow As Long
      lRow = Sheets("FullInvoice").Cells.SpecialCells(xlCellTypeVisible).Rows
      lRow = Sheets("FullInvoice").UsedRange.Cells(1, 1).Row
  
      Set xRange = Sheets("FullInvoice").Range("F65000")
  End Sub
  </code></pre>