![]() |
Positioning on a sheet
I want to get a macro that will position a particular part of a sheet to
show on my screen when it is opened up no matter where the sheet is when opened. In the past I have used the following which don't appear to work in Excel 2002: Range("CurrDay ").Select Application.Goto Reference:=Range("CurrDay") Any suggestions would be greatly appreciated. Roger |
Positioning on a sheet
Hi Roger,
Application.Goto Reference:=Range("CurrDay") works for me. You may wish to add the optional Scroll argument: Application.Goto Reference:=Range("CurrDay"), Scroll:= True which will ensure that the upper-left corner of the range appears in the upper-left corner of the window. If you want the positioning to occur when the file is opened, place the instruction in the Workbook_Open event, in the ThisWorkbook module, or the Auto_Open sub in a standard module. If your intent is that the positioning should occur whenever the sheet is opened, place the instruction in the sheets Worksheet_Activate procedure. --- Regards, Norman "Roger B." wrote in message ... I want to get a macro that will position a particular part of a sheet to show on my screen when it is opened up no matter where the sheet is when opened. In the past I have used the following which don't appear to work in Excel 2002: Range("CurrDay ").Select Application.Goto Reference:=Range("CurrDay") Any suggestions would be greatly appreciated. Roger |
Positioning on a sheet
Hi Roger,
To get to the ThisWorkbook that Norman said you can Right click on the the Excel logo to left of menus then "view code" You did not say where you used the code, so here is what you could use. Possibly you don't have the range defined, and it might show up better as two separate instructions Sub WorkBook_Open() Worksheets("Sheet1").Activate Range("CurrDay").Select End Sub --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Roger B." wrote in message ... I want to get a macro that will position a particular part of a sheet to show on my screen when it is opened up no matter where the sheet is when opened. In the past I have used the following which don't appear to work in Excel 2002: Range("CurrDay ").Select Application.Goto Reference:=Range("CurrDay") Any suggestions would be greatly appreciated. Roger |
Positioning on a sheet
Thanks to you both for the suggestions. Norman's with the Scroll is exactly
what I wanted. Roger "Norman Jones" wrote in message ... Hi Roger, Application.Goto Reference:=Range("CurrDay") works for me. You may wish to add the optional Scroll argument: Application.Goto Reference:=Range("CurrDay"), Scroll:= True which will ensure that the upper-left corner of the range appears in the upper-left corner of the window. If you want the positioning to occur when the file is opened, place the instruction in the Workbook_Open event, in the ThisWorkbook module, or the Auto_Open sub in a standard module. If your intent is that the positioning should occur whenever the sheet is opened, place the instruction in the sheets Worksheet_Activate procedure. --- Regards, Norman "Roger B." wrote in message ... I want to get a macro that will position a particular part of a sheet to show on my screen when it is opened up no matter where the sheet is when opened. In the past I have used the following which don't appear to work in Excel 2002: Range("CurrDay ").Select Application.Goto Reference:=Range("CurrDay") Any suggestions would be greatly appreciated. Roger |
All times are GMT +1. The time now is 11:03 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com