+ Reply to Thread
Results 1 to 6 of 6

Zoom on workbook open

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    Bruges
    MS-Off Ver
    Excel 2010
    Posts
    7

    Question Zoom on workbook open

    Hello

    I would like to zoom on a specific sheet (not the other sheets).
    I put this code in "This workbook" :
    Please Login or Register  to view this content.
    This works when the sheet opened when I open the excel file is SheetName but whent an other sheet is opened when I opent my file I have a bug.

    So I write this :
    Please Login or Register  to view this content.
    It seems to work but I think there is a much better way to do that !
    I don't like the "Activate" and the "Select" but don't know how to avoid them.
    Could you help me please ?
    Last edited by Adrian692; 06-05-2013 at 04:21 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Zoom on workbook open

    Hi, Adrian692,

    you would need to check this setting in the Worksheet_Activate for SheetName as well.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Zoom on workbook open

    Why not just?
    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  4. #4
    Registered User
    Join Date
    05-31-2013
    Location
    Bruges
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Zoom on workbook open

    Thanks for your answers .

    My code works when I save my file on SheetA but not when I save my file on Sheet2.

    I save the file when I 'm on "Sheet2" and close the excel file.
    Then I open my file. I 'm on "Sheet2" (perfect).
    But my code with Worksheets("Sheet1").Activate show the Sheet1 and I want to stay on the Sheet2 if I saved my file on Sheet2.

    How could I write this code to work in a "ghost mode" (without show Sheet1) ?

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Zoom on workbook open

    Hi, Adrian692,

    sorry I donīt understand what you ask for, code for ThisWorkbook, change Sheetname from A to suit your needs:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  6. #6
    Registered User
    Join Date
    05-31-2013
    Location
    Bruges
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Zoom on workbook open

    Thanks for your help .

+ 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