Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xlEnd And xlRight 1

Status
Not open for further replies.

NatHunter

Technical User
Aug 17, 2001
51
GB
Folks,

I want to select a cell and then select down and then right from this cell. I've got the down bit using xldown, but can't get the xlright bit working:

Range(ActiveCell, Selection.Cells.End(xlDown)).Select
Range(ActiveCell, Selection.Cells.xlRight).Select

Thanks

 
you can use

ActiveCell.CurrentRegion.copy

this copies complete block from activecell.



Thanks Rob.[yoda]
 
Try this:
Code:
ActiveCell.End(xlDown).Offset(0, 1).Select
Or of you want to select the right-most cell, use this:
Code:
ActiveCell.End(xlDown).End(xlToRight).Select
 
Take a look at Offset

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The constants for the END function are
xlup
xldown
xlTOright
xlTOleft

You could've found this out for yourself by pressing F1 and then searching for END and looking at the END property

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Thanks for all the replies - most appreciated.

Range(ActiveCell, Selection.Cells.End(xlDown).End(xlToRight)).Select

Is the required solution.

Paul

P.S.
I made the mistake of searching help for End, rather than using F1 to initiate the search. Doh!
 
Paul,

How posted a solution, but it can eat your lunch if you are doing alot of processing -- OVERUSING ACTIVATE & SELECT

faq707-4105 How Can I Make My Code Run Faster?

Most activating & selecting can be eliminated except for the last few statements of your procedure to set the position in your workbook to the place where you want the user to VIEW when the procedure ends.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top