Why doesn't the xlcelltypelastcell not giving the last cell inside a list if all other enumerations working perfectly inside a list like visiblecells and all. What is the shortest way (best way) to locate the last cell inside a list.
Why doesn't the xlcelltypelastcell not giving the last cell inside a list if all other enumerations working perfectly inside a list like visiblecells and all. What is the shortest way (best way) to locate the last cell inside a list.
What code are you using? When you say list, do you mean a list 2003 which is a table in 2007+ or do you mean a range? When you say last cell, do you mean last cell with data or last cell in the "list".
Using the SpecialCells method:
[vba]MsgBox Range("Table1").SpecialCells(xlCellTypeLastCell).Address[/vba]
This finds the last cell empty or not in a range or a "Table".
[VBA]With Range("Table1")
MsgBox .Areas(.Areas.Count).Cells(.Areas(.Areas.Count).Rows.Count, 1).Address
End With[/VBA]