I have 8 excel files I run this macro against to set a number format. On 7 of the files it works perfect, on one 0f the files it does not work correct. When I step through the macro, the lrow variable says the excel file only has 2 rows, when in actuality it has 80. When I step through the macro with the other 7 files, the lrow variable is correct. Trying to figure out what is different in this one file that would mess up the last row calc.
Dim lrow As Long
lrow = Cells(Cells.Rows.Count, "E").End(xlUp).Row
Range("E3:Q" & lrow).NumberFormat = "#,##0"