Last Cell Code

  • Thread starter Thread starter Terri
  • Start date Start date
T

Terri

What's the difference in this

Selection.SpecialCells(xlCellTypeLastCell).Select

and this

ActiveCell.SpecialCells(xlLastCell).Select
 
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.
 
So the words CellType doesn't need to be in the line of
code to have the same result?
(xlCellTypeLastCell)
or
(xlLastCell)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top