Macro to go to end of list

Nobby

Board Regular
Joined
Feb 25, 2002
Messages
68
I need a macro to allow a user to go to the end of a list of data.

The list is in a named range "TypeofConcern"

So far I've got:

Application.Goto Reference:="TypeofConcern"

Set LastCell = [AA65536].End(xlUp)
SelectCell
End Sub

This just selects the entire named range - and I want the user to be taken to the first blank cell at the end of the list.

Anyone tell me what's missing?

Cheers.

Nobby
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
If there are no empty cells in your range, try:

Code:
Range("TypeofConcern").End(xlDown).Offset(1).Select

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-05-01 10:46
 
Upvote 0
Cheers NatO, that will work, except that it selects the last cell with data.

What do I need to add to make it jump down 1 cell?

Nobby
 
Upvote 0
Sorry NatO - it does work.

I hadn't picked up the Offset(1) part when I c+p

Cheers

Nobby
 
Upvote 0
NatO,

All working OK, but from a user point of view, it would be better if, once the blank cell is found, it was centered in the middle of the screen rather than appearing at the edge.

Is there a simple way of telling the macro to centre the view?

Nobby
 
Upvote 0
Scratch that, use the following, you won't get errors if you're on a different worksheet while executing the code:

Code:
Application.Goto Range("TypeofConcern").End(xlDown).Offset(1)
 
Upvote 0
Is there a simple way of telling the macro to centre the view

Yep, at the bottom of your code place this line:

Code:
CenterOnCell ActiveCell

Now go to the following site:

http://www.cpearson.com/excel/zoom.htm

And place Chip's procedure "CenterOnCell(OnCell As Range)" in the same code module.

Hope this helps.

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-05-01 11:19
 
Upvote 0
NatO,

Added it all in, together with Chip's code and all's working well.

A good nights work! Thanks for the help.

Cheers.

Nobby
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top