+ Reply to Thread
Results 1 to 11 of 11

Page Position

  1. #1
    koreanwarbaby
    Guest

    Page Position

    My worksheet opens halfway down the page. How can I get it to open at the top?

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Make sure you are at the top when you SAVE the file. Excel opens to the location you were at when you saved the file.

    Alternately, you could put code in the Workbook Open event as such:

    [vba]Private Sub Workbook_Open()
    Sheets("sheet1").Select
    Range("A1").Select
    End Sub[/vba]

    Adjust the sheet name to meet your requirements.

    Good Luck.
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    David
    Guest

    Re: Page Position

    swatsp0p wrote

    > Alternately, you could put code in the Workbook Open event as such:
    >
    > Private Sub Workbook_Open()
    > Sheets("sheet1").Select
    > Range("A1").Select
    > End Sub


    Or,
    Application.Goto Sheets(1).Range("A1"), True

    --
    David

  4. #4
    unbehaun
    Guest

    Re: Page Position

    Hi, David!

    I'm a newbie, so I must ask how to go about putting code in the Workbook
    Open event. Thanks!

    "David" wrote:

    > swatsp0p wrote
    >
    > > Alternately, you could put code in the Workbook Open event as such:
    > >
    > > Private Sub Workbook_Open()
    > > Sheets("sheet1").Select
    > > Range("A1").Select
    > > End Sub

    >
    > Or,
    > Application.Goto Sheets(1).Range("A1"), True
    >
    > --
    > David
    >


  5. #5
    Dave Peterson
    Guest

    Re: Page Position

    Fred????

    Open your workbook
    rightclick on the excel icon to the left of the File|Edit|View dropdown options.
    Select view code.

    Paste swatsp0p's code in there

    Back to excel
    save your workbook
    close it
    reopen it with macros enabled.

    Did it work???



    unbehaun wrote:
    >
    > Hi, David!
    >
    > I'm a newbie, so I must ask how to go about putting code in the Workbook
    > Open event. Thanks!
    >
    > "David" wrote:
    >
    > > swatsp0p wrote
    > >
    > > > Alternately, you could put code in the Workbook Open event as such:
    > > >
    > > > Private Sub Workbook_Open()
    > > > Sheets("sheet1").Select
    > > > Range("A1").Select
    > > > End Sub

    > >
    > > Or,
    > > Application.Goto Sheets(1).Range("A1"), True
    > >
    > > --
    > > David
    > >


    --

    Dave Peterson

  6. #6
    unbehaun
    Guest

    Re: Page Position

    Dave,

    I've seen a "Fred" in my family history book. Where's he from? I live in
    NW Minnesota, but my clan is from Richland Center, Wisconsin (an hour NW of
    Madison).

    If I put the cursor at the top, then save, it opens at the top. But this is
    inconvenient.

    Followed your directions, then had to reduce the security level. When I
    enable the macro, I get a "Run-time error '9': Subscript out of range." When
    I debug, the second line is highlighted in yellow.

    Any help you can give is appreciated!
    "Dave Peterson" wrote:

    > Fred????
    >
    > Open your workbook
    > rightclick on the excel icon to the left of the File|Edit|View dropdown options.
    > Select view code.
    >
    > Paste swatsp0p's code in there
    >
    > Back to excel
    > save your workbook
    > close it
    > reopen it with macros enabled.
    >
    > Did it work???
    >
    >
    >
    > unbehaun wrote:
    > >
    > > Hi, David!
    > >
    > > I'm a newbie, so I must ask how to go about putting code in the Workbook
    > > Open event. Thanks!
    > >
    > > "David" wrote:
    > >
    > > > swatsp0p wrote
    > > >
    > > > > Alternately, you could put code in the Workbook Open event as such:
    > > > >
    > > > > Private Sub Workbook_Open()
    > > > > Sheets("sheet1").Select
    > > > > Range("A1").Select
    > > > > End Sub
    > > >
    > > > Or,
    > > > Application.Goto Sheets(1).Range("A1"), True
    > > >
    > > > --
    > > > David
    > > >

    >
    > --
    >
    > Dave Peterson
    >


  7. #7
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Is it possible that your worksheets are named other than 'Sheet1'? If so, change the reference in the macro to match the name of the sheet you want to open to.

    good luck

    Bruce

  8. #8
    Dave Peterson
    Guest

    Re: Page Position

    Fred is a former co-worker in northern Illinois--so maybe...

    This line specifies the name of the worksheet.

    Sheets("sheet1").Select

    Change Sheet1 to the name of the sheet you really want selected when the
    workbook opens.


    unbehaun wrote:
    >
    > Dave,
    >
    > I've seen a "Fred" in my family history book. Where's he from? I live in
    > NW Minnesota, but my clan is from Richland Center, Wisconsin (an hour NW of
    > Madison).
    >
    > If I put the cursor at the top, then save, it opens at the top. But this is
    > inconvenient.
    >
    > Followed your directions, then had to reduce the security level. When I
    > enable the macro, I get a "Run-time error '9': Subscript out of range." When
    > I debug, the second line is highlighted in yellow.
    >
    > Any help you can give is appreciated!
    > "Dave Peterson" wrote:
    >
    > > Fred????
    > >
    > > Open your workbook
    > > rightclick on the excel icon to the left of the File|Edit|View dropdown options.
    > > Select view code.
    > >
    > > Paste swatsp0p's code in there
    > >
    > > Back to excel
    > > save your workbook
    > > close it
    > > reopen it with macros enabled.
    > >
    > > Did it work???
    > >
    > >
    > >
    > > unbehaun wrote:
    > > >
    > > > Hi, David!
    > > >
    > > > I'm a newbie, so I must ask how to go about putting code in the Workbook
    > > > Open event. Thanks!
    > > >
    > > > "David" wrote:
    > > >
    > > > > swatsp0p wrote
    > > > >
    > > > > > Alternately, you could put code in the Workbook Open event as such:
    > > > > >
    > > > > > Private Sub Workbook_Open()
    > > > > > Sheets("sheet1").Select
    > > > > > Range("A1").Select
    > > > > > End Sub
    > > > >
    > > > > Or,
    > > > > Application.Goto Sheets(1).Range("A1"), True
    > > > >
    > > > > --
    > > > > David
    > > > >

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

  9. #9
    unbehaun
    Guest

    Re: Page Position

    Renaming it did the trick. Thanks!

    "swatsp0p" wrote:

    >
    > Is it possible that your worksheets are named other than 'Sheet1'? If
    > so, change the reference in the macro to match the name of the sheet
    > you want to open to.
    >
    > good luck
    >
    > Bruce
    >
    >
    > --
    > swatsp0p
    >
    >
    > ------------------------------------------------------------------------
    > swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
    > View this thread: http://www.excelforum.com/showthread...hreadid=373890
    >
    >


  10. #10
    unbehaun
    Guest

    Re: Page Position

    Renaming it was the solution--thanks! I know that Fred Unbehaun is related,
    but I've never met him (probably third cousin by now). We have a family
    reunion the last Sunday in June in SW Wisconsin, but I don't know if he
    comes. I can't make it this year because I'm gonna be a GRANDPA in a couple
    of weeks! Bye, Dave!

    "Dave Peterson" wrote:

    > Fred is a former co-worker in northern Illinois--so maybe...
    >
    > This line specifies the name of the worksheet.
    >
    > Sheets("sheet1").Select
    >
    > Change Sheet1 to the name of the sheet you really want selected when the
    > workbook opens.
    >
    >
    > unbehaun wrote:
    > >
    > > Dave,
    > >
    > > I've seen a "Fred" in my family history book. Where's he from? I live in
    > > NW Minnesota, but my clan is from Richland Center, Wisconsin (an hour NW of
    > > Madison).
    > >
    > > If I put the cursor at the top, then save, it opens at the top. But this is
    > > inconvenient.
    > >
    > > Followed your directions, then had to reduce the security level. When I
    > > enable the macro, I get a "Run-time error '9': Subscript out of range." When
    > > I debug, the second line is highlighted in yellow.
    > >
    > > Any help you can give is appreciated!
    > > "Dave Peterson" wrote:
    > >
    > > > Fred????
    > > >
    > > > Open your workbook
    > > > rightclick on the excel icon to the left of the File|Edit|View dropdown options.
    > > > Select view code.
    > > >
    > > > Paste swatsp0p's code in there
    > > >
    > > > Back to excel
    > > > save your workbook
    > > > close it
    > > > reopen it with macros enabled.
    > > >
    > > > Did it work???
    > > >
    > > >
    > > >
    > > > unbehaun wrote:
    > > > >
    > > > > Hi, David!
    > > > >
    > > > > I'm a newbie, so I must ask how to go about putting code in the Workbook
    > > > > Open event. Thanks!
    > > > >
    > > > > "David" wrote:
    > > > >
    > > > > > swatsp0p wrote
    > > > > >
    > > > > > > Alternately, you could put code in the Workbook Open event as such:
    > > > > > >
    > > > > > > Private Sub Workbook_Open()
    > > > > > > Sheets("sheet1").Select
    > > > > > > Range("A1").Select
    > > > > > > End Sub
    > > > > >
    > > > > > Or,
    > > > > > Application.Goto Sheets(1).Range("A1"), True
    > > > > >
    > > > > > --
    > > > > > David
    > > > > >
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    > --
    >
    > Dave Peterson
    >


  11. #11
    Dave Peterson
    Guest

    Re: Page Position

    If you see Fred or his father Earl (both former co-workers), say hey for me!

    unbehaun wrote:
    >
    > Renaming it was the solution--thanks! I know that Fred Unbehaun is related,
    > but I've never met him (probably third cousin by now). We have a family
    > reunion the last Sunday in June in SW Wisconsin, but I don't know if he
    > comes. I can't make it this year because I'm gonna be a GRANDPA in a couple
    > of weeks! Bye, Dave!
    >
    > "Dave Peterson" wrote:
    >
    > > Fred is a former co-worker in northern Illinois--so maybe...
    > >
    > > This line specifies the name of the worksheet.
    > >
    > > Sheets("sheet1").Select
    > >
    > > Change Sheet1 to the name of the sheet you really want selected when the
    > > workbook opens.
    > >
    > >
    > > unbehaun wrote:
    > > >
    > > > Dave,
    > > >
    > > > I've seen a "Fred" in my family history book. Where's he from? I live in
    > > > NW Minnesota, but my clan is from Richland Center, Wisconsin (an hour NW of
    > > > Madison).
    > > >
    > > > If I put the cursor at the top, then save, it opens at the top. But this is
    > > > inconvenient.
    > > >
    > > > Followed your directions, then had to reduce the security level. When I
    > > > enable the macro, I get a "Run-time error '9': Subscript out of range." When
    > > > I debug, the second line is highlighted in yellow.
    > > >
    > > > Any help you can give is appreciated!
    > > > "Dave Peterson" wrote:
    > > >
    > > > > Fred????
    > > > >
    > > > > Open your workbook
    > > > > rightclick on the excel icon to the left of the File|Edit|View dropdown options.
    > > > > Select view code.
    > > > >
    > > > > Paste swatsp0p's code in there
    > > > >
    > > > > Back to excel
    > > > > save your workbook
    > > > > close it
    > > > > reopen it with macros enabled.
    > > > >
    > > > > Did it work???
    > > > >
    > > > >
    > > > >
    > > > > unbehaun wrote:
    > > > > >
    > > > > > Hi, David!
    > > > > >
    > > > > > I'm a newbie, so I must ask how to go about putting code in the Workbook
    > > > > > Open event. Thanks!
    > > > > >
    > > > > > "David" wrote:
    > > > > >
    > > > > > > swatsp0p wrote
    > > > > > >
    > > > > > > > Alternately, you could put code in the Workbook Open event as such:
    > > > > > > >
    > > > > > > > Private Sub Workbook_Open()
    > > > > > > > Sheets("sheet1").Select
    > > > > > > > Range("A1").Select
    > > > > > > > End Sub
    > > > > > >
    > > > > > > Or,
    > > > > > > Application.Goto Sheets(1).Range("A1"), True
    > > > > > >
    > > > > > > --
    > > > > > > David
    > > > > > >
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1