LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Navigating

Hafeez,

End(xlDown) or End(xlToRight) behave in exactly the same way as if you
were using the End key followed by the Down Arrow key or the Right Arrow
key. Let's say you're using ActiveCell.End(xlDown).Select and you have a
column of data like this:

Hello
Hi
<blank
Howdy
How are you
Hooray
<blank
Huzzah

Where you end up in this column depends on where you start. If you start
at Hello, you'll end up at Hi (because there's a blank cell as the next
cell). If you start at Howdy, you'll end up at Hooray.

If every single cell in the column has data/formulas, when you do
End(xlDown), then you will end up on the cell in the last row.

So you have to be really careful when using End(xlDown), because if you
do have blanks, you won't necessarily get the last row.

What I usually do is to use End(xlUp). If you start at A65535 and do
End(xlUp), you should end up in the last row of data (unless of course
the last row of data has a blank cell in column A).

Anyway, experiment a bit with the keyboard equivalents and make sure you
understand how they work. Then just translate them into VBA --
End(xlDown) etc.

--
HTH,
Dianne

In ,
Hafeez Esmail typed:
Out of all the solutions I think I like this one the best!
I did note the clause when selecting the last cell. This
leads me to one last question. How do you select the last
cell in a row/column that HAS data?

Thanks for all your help!
"Dianne" wrote in message
...
Sorry about the first post -- tripped over my fingers:

One cell left:
ActiveCell.Offset(0,-1).Select

One cell right:
ActiveCell.Offset(0,1).Select

One cell down:
ActiveCell.Offset(1,0).Select

One cell up:
ActiveCell.Offset(-1,0).Select

Bottom of the column (assuming there is data in every row):
ActiveCell.End(xlDown).Select

End of row (assuming there is data in each column):
ActiveCell.End(xlToRight).Select

--
HTH,
Dianne

In ,
Hafeez Esmail typed:
I've looked all over for this info but can't find it.

If my active cell is H396, how would I do the following?
Move one cell to the left/right/up/down?
Move to the bottom of this column?
Move to the end of this row?

Thanks
Hafeez Esmail



.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigating ~ One Fine Old Dude Excel Worksheet Functions 0 June 6th 07 06:38 PM
Navigating ~ One Fine Old Dude Excel Worksheet Functions 0 June 6th 07 06:35 PM
navigating with the tab key Cynthia[_2_] New Users to Excel 1 April 17th 07 05:18 PM
Navigating Excelbanter dalymjl Excel Discussion (Misc queries) 0 September 30th 06 12:30 PM
Navigating Gibbie Excel Discussion (Misc queries) 9 January 31st 05 10:49 PM


All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"