Setting End Of Sheet

  • Thread starter Thread starter Trevor
  • Start date Start date
T

Trevor

Hi,
Hope someone can help.
I need to be able to set the 'end of sheet' as in Ctrl+End
If I make a sheet of (say) 5 columns by 20 Rows and
Ctrl+End the cursor goes to cell E20.
If I then delete rows 2 to 20 (Rows not contents), and
repeat Ctrl+End the cursor still selects Cell E20. I want
it to select E1.
I am actually doing the deletion etc. in code, and I am
deleting the rows rather than the contents, I want the
code equivalent (which I can work out how to do once given
a pointer to how) of Ctrl+End to take me to the end of the
revised sheet

TIA
Trev
 
Hi Trevor,

Try this

ActiveSheet.UsedRange
ActiveCell.SpecialCells(xlLastCell).Select

The second line takes you to the end, but the first line is needed to reset
the usedrange pointer after some lines are deleted.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks Bob, Just tried it, works a treat.
Ps do you spend all day looking at this newsgroup
Trevor
 

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