Think you have data in a cells of column "A". And you want to identify the last cell of that column having data. (i.e. You want to get last row number having data). In such occasion use below code. value of Z-1 will be last row having data. Value of Z will be next empty row.
But there shouldn't be any empty cells in between along that column.
'Find last cell of column "A" filled with data Dim z As Integer z = 3 Do Until Worksheets("Sheet1").Range("A" & z).Value = "" z = z + 1 Loop '(z-1=Last row having data) |