End Of File in Code

B

BatMan

I import files into a workbook. Is there a way in code, to determine the
last row in the file. Much like the CTRL END command takes you the
end of the file. I want to be able to get a numeric value that I store into
a variable.
 
D

Don Guillett

this gives the last row in col A. of the active worksheet.
x=cells(rows.count,"a").end(xlup).row

BTW, file means workbook. there are worksheets within the workbook.
 
Top