Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ayden Smith   on Sep 30 In MS Office Category.

  
Question Answered By: Scott Anderson   on Sep 30

Here's one approach:
When in Excel, entering Cntl-End will take you to the last row/column.
In VBA, you use:

ActiveCell.SpecialCells(xlLastCell).Select
Then Selection.Row and Selection.Column are the row  and Column
Cells(1,Selection.Column + 1) = Selection.Column + 1
Cells(Selection.Row + 1,1) = Selection.Row + 1
will place the Row number  and column  Number in the next row or Column.

This approach  can be unpredictable, because if data  is removed, the
columns will not be identified as "blank" until the file is saved and
re-opened.

Are there any rows or columns that you KNOW will have data?
(column headings, perhaps a serial number?)
If so, you can use worksheetfunction counta to count the rows or
columns.

Share: 

 

This Question has 11 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Last Row and Column Or get search suggestion and latest updates.


Tagged: