Last Cell Code

T

Terri

What's the difference in this

Selection.SpecialCells(xlCellTypeLastCell).Select

and this

ActiveCell.SpecialCells(xlLastCell).Select
 
T

Tom Ogilvy

There is no difference.

the top level qualifier (selection or activecell) has no effect on the
result.

You can also use

Range("A1").SpecialCells(xlCellTypeLastCell).Select

Cells.SpecialCells(xlCellTypeLastCell).Select

either of which would give identical results to the two you presented.
 
G

Guest

So the words CellType doesn't need to be in the line of
code to have the same result?
(xlCellTypeLastCell)
or
(xlLastCell)
 
T

Tom Ogilvy

Guess I misunderstood what the exact question was.


No, that doesn't make any difference either.

They both resolve to the same constant value:

? xlCellTypeLastCell
11
? xlLastCell
11
 
Top