excel用快捷键放大和缩小工作表
时间:2023-09-30 10:55:14
Excel中的许多命令都可以使用快捷键来完成,但仍然有一些命令没有指定快捷键。例如在“常用”工具栏中的“显示比例”命令。我们可以用下面的VBA代码来实现用快捷键调整工作表显示比例,将下列代码输入到标准模块中:
Sub ZoomIn()
Dim ZP As Integer
ZP = Int(ActiveWindow.Zoom * 1.1)
If ZP > 400 Then ZP = 400
ActiveWindow.Zoom = ZP
End Sub
Sub ZoomOut()
Dim ZP As Integer
ZP = Int(ActiveWindow.Zoom * 0.9)
If ZP < 10 Then ZP = 10
ActiveWindow.Zoom = ZP
End Sub
每执行一次上述代码,ZoomIn()可以将当前工作表的显示比例放大10%,ZoomOut()可以将当前工作表的显示比例缩小10%,需要说明的是Excel只允许将显示比例最大调整到400%,最小到10%,超过这个比例将停止放大或缩小。
下面给这两个宏指定快捷键,方法如下:
1.单击菜单“工具→宏→宏”,或按Alt+F8,打开“宏”对话框。
2.选择宏“ZoomIn”,单击“选项”按钮,在“Ctrl+”右侧的文本框中输入指定的英文字母,如“i”,单击“确定”按钮,然后关闭“宏”对话框。这样,当按快捷键“Ctrl+i”时将放大工作表,注意指定快捷键时最好不要与系统快捷键相冲突,如Ctrl+O为系统给定的显示“打开”对话框,指定快捷键时就不用“Ctrl+O”。
3.用同样的方法给宏“ZoomOut”也指定一个快捷键,如“Ctrl+j”,这样,当按快捷键“Ctrl+j”时将缩小工作表。
标签:工作,快捷键,指定,比例,Excel函数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Office Excel2019/365快捷键常用大全1-Excel组合操作快捷键
2022-12-11 06:21:47
![](https://img.aspxhome.com/file/2023/1/a154141_0s.png)
windows10重装windows7系统的详细方法步骤教程
2023-07-08 22:03:01
![](https://img.aspxhome.com/file/2023/4/a306520_0s.jpg)
Win10 TH2预览版10586桌面水印消失怎么办?预览版需重注册
2023-07-30 14:17:28
![](https://img.aspxhome.com/file/2023/28/a246517_0s.jpg)
拖动滚动条找到切换全屏视图
2023-07-29 21:51:24
华硕主板电脑关机了键盘灯还亮着怎么解决?
2022-03-10 16:28:32
![](https://img.aspxhome.com/file/2023/6/a322079_0s.jpg)
win7如何查看端口被谁占用_win7查看端口被谁占用的教程
2023-06-01 18:24:27
![](https://img.aspxhome.com/file/2023/2/a288216_0s.png)
声卡驱动怎么更新_声卡驱动更新的教程
2022-04-03 04:36:07
![](https://img.aspxhome.com/file/2023/3/a294135_0s.png)
WPS 如何使用查找功能把邮箱地址一次性全部提取出来
2023-04-08 01:00:12
![](https://img.aspxhome.com/file/2023/0/a186950_0s.jpg)
excel 列宽自动适应内容 提取数据快速填充数值 冻结单元格 实现教程,以Excel 2016为例
2023-11-16 14:00:04
![](https://img.aspxhome.com/file/2023/8/a154338_0s.jpg)
熊猫看书为什么看不了目录?看不了目录的解决方法
2022-04-25 08:37:32
![](https://img.aspxhome.com/file/2023/7/a332271_0s.jpg)
Excel中怎样标上标符?
2023-07-11 08:57:08
![](https://img.aspxhome.com/file/2023/5/37035_0s.png)
Win10系统窗口颜色怎么调?Win10系统窗口颜色调整教程
2023-03-07 15:58:06
![](https://img.aspxhome.com/file/2023/26/a221044_0s.png)
Windows7蓝屏报错0x000000a的解决方法
2022-04-07 21:47:19
![](https://img.aspxhome.com/file/2023/2/a286048_0s.jpg)
百度怎么清理缓存?手机百度清除缓存的方法
2023-05-13 03:34:49
![](https://img.aspxhome.com/file/2023/7/a330617_0s.jpg)
Word批量设置页脚,同事熬夜到天亮,我5秒全搞定!
2023-10-21 05:56:38
![](https://img.aspxhome.com/file/2023/5/24405_0s.gif)
IE浏览器一直出现停止工作提示的解决办法
2023-08-17 10:24:46
![](https://img.aspxhome.com/file/2023/4/a304925_0s.jpg)
XP系统找回资源管理器里的文件夹选项的方法
2023-10-12 02:24:27
![](https://img.aspxhome.com/file/2023/2/a291873_0s.jpg)
Win10更新KB3116869补丁出现错误0x80004005的解决方法
2022-12-09 01:36:38
![](https://img.aspxhome.com/file/2023/26/a226332_0s.jpg)
解决Win10系统桌面右键菜单刷新没有显示图标的方法
2023-03-20 11:17:10
![](https://img.aspxhome.com/file/2023/3/a302834_0s.jpg)
Win10系统怎么切换专用或公用网络?
2023-09-06 21:21:39
![](https://img.aspxhome.com/file/2023/1/a275198_0s.jpg)