Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default 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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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








Reply
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
Hyperlink in same sheet - positioning problem neil40 Links and Linking in Excel 1 November 27th 09 09:52 PM
Positioning a char in a sheet Rui Álvares Excel Programming 2 July 19th 05 04:11 AM
Positioning Roger[_20_] Excel Programming 4 July 8th 05 08:54 PM
wrong positioning of data in sheet after clearcontents() Rea Excel Programming 1 June 21st 05 12:22 PM
Recalculate sheet & Positioning text boxes George Andrews Excel Programming 1 May 17th 05 10:56 PM


All times are GMT +1. The time now is 03:21 PM.

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"