使EXCEL里数据有效性列表显示得更大些的方法
时间:2023-10-16 05:46:21
在使用excel时,当使用数据有效性创建下拉列表时,不能够改变字体或字体大小。如果缩小工作表的尺寸,那么将难以阅读列表中的项目。
要使列表中的文本看起来更大,可以使用VBA代码,使得在选择数据有效性单元格时增大工作表缩放尺寸设置,从而使数据有效性列表中的文本看起来更大。
下面的代码在选择数据有效性列表单元格时将工作表的尺寸缩放为120%。如果选择的单元格中没有设置数据有效性,那么工作表尺寸缩放为100%。
代码
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim lZoom As Long Dim lZoomDV As Long Dim lDVType As Long lZoom = 100 lZoomDV = 120 lDVType = 0 Application.EnableEvents = False On Error Resume Next lDVType = Target.Validation.Type On Error GoTo errHandler If lDVType <> 3 Then With ActiveWindow If .Zoom <> lZoom Then .Zoom = lZoom End If End With Else With ActiveWindow If .Zoom <> lZoomDV Then .Zoom = lZoomDV End If End With End IfexitHandler: Application.EnableEvents = True Exit SuberrHandler: GoTo exitHandlerEnd Sub
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
除法excel函数百分数怎么使用
excel表格怎么放大打印?
![](https://img.aspxhome.com/file/2023/3/a153303_0s.jpg)
无线网络连接上但上不了网的原因和解决方法
![](https://img.aspxhome.com/file/2023/9/a340930_0s.jpg)
Windows7暗藏的管理功能之上帝模式如何调用
![](https://img.aspxhome.com/file/2023/29/a255948_0s.jpg)
wps怎么添加边框
![](https://img.aspxhome.com/file/2023/5/a169105_0s.jpg)
wps怎么制作图片层层叠加的效果图
电脑开机自动打开我的excel文档和自动打开文件夹操作技巧
![](https://img.aspxhome.com/file/2023/7/a162447_0s.jpg)
Win11和Win10中谷歌Chrome浏览器速度慢怎么解决?
![](https://img.aspxhome.com/file/2023/1/a277461_0s.jpg)
PowerPoint2007配色技巧
![](https://img.aspxhome.com/file/2023/10/a345135_0s.gif)
Win10玩《武装突袭3》超级卡顿该怎么办?
![](https://img.aspxhome.com/file/2023/4/a312078_0s.jpg)
win7开机黑屏只有鼠标的三种解决方法
![](https://img.aspxhome.com/file/2023/28/a249861_0s.png)
微软Win10 3月累计更新KB5011487(19044.1586)补丁发布!
![](https://img.aspxhome.com/file/2023/1/a275558_0s.jpg)
Win7兼容性设置的方法
![](https://img.aspxhome.com/file/2023/27/a231999_0s.jpg)
Win11电脑屏幕倒过来了怎么办?Win11电脑屏幕倒过来了解决方法
![](https://img.aspxhome.com/file/2023/27/a238588_0s.jpg)
xp系统IE工具栏中的顽固网站链接怎么删除
excel批量导入手机联系人方法介绍
![](https://img.aspxhome.com/file/2023/5/41665_0s.jpg)
如何跳过Safari浏览器看视频时的广告
excel如何提取复姓?
wps诗歌文字怎么排成扇形
![](https://img.aspxhome.com/file/2023/0/a163480_0s.png)
多种工具安装系统及双系统实例使用方法
![](https://img.aspxhome.com/file/2023/5/a319202_0s.jpg)