Get the Row and Column Number of the Last Cell Containing Data
Sub FindDataExtent() Dim ws As Worksheet Set ws = ActiveSheet Dim iLastRow As Integer iLastRow = ws.Cells(ws.Rows.Count, "a").End(xlUp).Row Dim iLastCol As Integer iLastCol = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column End Sub