Disable zooming in excel

teranprasanna
Lounger
Posts: 27
Joined: 24 Jun 2020, 01:39

Disable zooming in excel

Post by teranprasanna »

Hi All,

Can we disable zooming in excel using VBA?


Thanks!

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Disable zooming in excel

Post by HansV »

Is this for yourself, or do you want to prevent all users of your workbooks from zooming in?
What if someone has limited eyesight and needs to enlarge the cells in order to view them?
Best wishes,
Hans

teranprasanna
Lounger
Posts: 27
Joined: 24 Jun 2020, 01:39

Re: Disable zooming in excel

Post by teranprasanna »

Thanks Hans..

Purpose is to limit specify cell area for the viewer. Example I wanted to show only the columns A to M, I blocked scrolling using VBA.. But if someone can zoom out, they can see columns beyond M.. this is the reason behind this query.

Can we achieve above purpose using any other way in VBA?

Regards,
Teran

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Disable zooming in excel

Post by HansV »

You could hide the columns and rows that you don't want the users to see.
For example:
- Press F5 to display the Go To dialog.
- Enter N:XFD in the box.
- Press Enter or click OK.
- Right-click any of the selected column headers.
- Select Hide from the context menu.
Everything to the right of column M will be hidden:

S0576.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

teranprasanna
Lounger
Posts: 27
Joined: 24 Jun 2020, 01:39

Re: Disable zooming in excel

Post by teranprasanna »

Thanks, Hans..