![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: United Kingdom
Posts: 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 |
|
|
|
|
|
#2 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
If there are no empty cells in your range, try:
Code:
Range("TypeofConcern").End(xlDown).Offset(1).Select
Cheers, NateO [ This Message was edited by: NateO on 2002-05-01 10:46 ] |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: United Kingdom
Posts: 68
|
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 |
|
|
|
|
|
#4 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Re worked it, see above. Sorry about unannounced edit.
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: United Kingdom
Posts: 68
|
Sorry NatO - it does work.
I hadn't picked up the Offset(1) part when I c+p Cheers Nobby |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: United Kingdom
Posts: 68
|
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 |
|
|
|
|
|
#7 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
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)
|
|
|
|
|
|
#8 | |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Quote:
Code:
CenterOnCell ActiveCell 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, NateO [ This Message was edited by: NateO on 2002-05-01 11:19 ] |
|
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Feb 2002
Location: United Kingdom
Posts: 68
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|