ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   End Of File in Code (https://www.excelbanter.com/excel-programming/299539-end-file-code.html)

BatMan

End Of File in Code
 
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.








Don Guillett[_4_]

End Of File in Code
 
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.
--
Don Guillett
SalesAid Software

"BatMan" wrote in message
...
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.











All times are GMT +1. The time now is 02:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com