+ Reply to Thread
Results 1 to 10 of 10

How to keep zoom set to 100% in a workbook?

  1. #1
    Registered User
    Join Date
    02-22-2019
    Location
    Pennsylvania
    MS-Off Ver
    2016
    Posts
    5

    How to keep zoom set to 100% in a workbook?

    I'm currently making a form in excel which can dynamically change picture placements based on user input. So far I've done everything without needing to use any VBA. My current issue is that when I zoom out the pictures become misaligned and don't always realign when I zoom back in so I'm looking for a way to keep the zoom at 100% whenever a user might try to change it. I've done a bit of research on the code required but I figured I'd ask here myself.

    Here's what I can think of to do:

    Please Login or Register  to view this content.
    This could be totally off but that's why I'm here. Any suggestions on how to do this and where to place the code would be much appreciated.

    Thanks!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,394

    Re: How to keep zoom set to 100% in a workbook?

    This will have to be done at the sheet level. This is one of the rare occasions that you have to activate something in VB. Put this code in the workbook module

    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    02-22-2019
    Location
    Pennsylvania
    MS-Off Ver
    2016
    Posts
    5

    Re: How to keep zoom set to 100% in a workbook?

    Thanks for the response! Just so I understand, how exactly is this being activated? Is it just running constantly? Do I need to place the sub within an if statement?

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,394

    Re: How to keep zoom set to 100% in a workbook?

    This happens when the workbook opens.

    If the user changes the zoom level, this will not catch it. You could put code on each sheet module to set its zoom when it is opened or closed or even get more agressive.
    Please Login or Register  to view this content.
    This code will reset the Zoom Level every time a user selects any cell. The user can still change the zoom level, but it will be reset each time a new cell is selected. I don't know of any event or setting that will prevent the user from accessing the zoom level.

  5. #5
    Registered User
    Join Date
    02-22-2019
    Location
    Pennsylvania
    MS-Off Ver
    2016
    Posts
    5

    Re: How to keep zoom set to 100% in a workbook?

    So there's no way for excel to trigger an event when the zoom level changes?

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,394

    Re: How to keep zoom set to 100% in a workbook?

    To the best my knowledge there is no such event. The limited amount of research I did came up with solutions similar to the ones I presented. You can't stop it, but you can reset it.

  7. #7
    Registered User
    Join Date
    02-22-2019
    Location
    Pennsylvania
    MS-Off Ver
    2016
    Posts
    5

    Re: How to keep zoom set to 100% in a workbook?

    What about maybe resetting it recurrently over a small time interval?

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,394

    Re: How to keep zoom set to 100% in a workbook?

    If you have it set up to reset each time a new cell is selected then there is little value resetting periodically. If a user doesn't select a cell, then why is there a need for change? No work was done. If the user does select a cell then the zoom is reset.

    Besides, running timers takes overhead.

  9. #9
    Registered User
    Join Date
    02-22-2019
    Location
    Pennsylvania
    MS-Off Ver
    2016
    Posts
    5

    Re: How to keep zoom set to 100% in a workbook?

    Like I said in my original post, if I zoom out and then zoom back in the images I'm using can become misaligned with where they are supposed to be. Selecting cells and editing information is irrelevant to this problem. So resetting the zoom value when a cell is selected will not solve my problem.

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,394

    Re: How to keep zoom set to 100% in a workbook?

    Since you can't stop the user from zooming, you need to address the issue of the images getting misaligned. Either keep them from getting misaligned at any setting or at least revert to their proper positions at 100%.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 09-10-2013, 10:55 PM
  2. [SOLVED] Zoom on workbook open
    By Adrian692 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2013, 04:21 PM
  3. [SOLVED] Change Workbook Open event Zoom via VBA
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2012, 08:58 PM
  4. setting all sheets in workbook to same zoom level?
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2006, 07:05 PM
  5. Zoom to 400%
    By Kent Smith in forum Excel General
    Replies: 0
    Last Post: 04-07-2006, 04:10 PM
  6. Replies: 5
    Last Post: 04-05-2006, 09:14 PM
  7. Zoom value
    By Glen Mettler in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-01-2005, 12:06 AM

Tags for this Thread

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