View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Ctrl+End with VBA

Hi Dave B,

how do I find the last cell in the used range using VBA)?


Try:

Dim rng As Range

Set rng = Cells.SpecialCells(xlCellTypeLastCell)

Note that the last cell in the used range may not be populated.

---
Regards,
Norman



"Dave B" wrote in message
...
How can I use VBA to find out which cell Excel would move to if I pressed
Ctrl+End (i.e. how do I find the last cell in the used range using VBA)?
Thanks.