Hello. I saw this codeas a way to get to the last active row. However, I've seen it done another more common way, but I forget the code. Which way is best?![]()
Please Login or Register to view this content.
Hello. I saw this codeas a way to get to the last active row. However, I've seen it done another more common way, but I forget the code. Which way is best?![]()
Please Login or Register to view this content.
Use this:
![]()
Please Login or Register to view this content.
Never use Merged Cells in Excel
But what's the difference?
Just a couple of points to note:
UsedRange.Rows.Count will get you the lastrow used row for the whole worksheet. This may not be what you want (e.g. Maybe you have subtotal rows you don't want to include). While zbor's way will be column specific. Another iteration of UsedRange.Rows.Count is the use of specialcells. ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row.
One more point. Specifying a numerical row using zbor's example could be problematic depending on the version of excel. Generally, this is more acceptable:
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks