WPS表格如何快速隐藏不使用的区域
时间:2022-08-02 17:44:00
小编教你WPS表格快速隐藏不使用的区域的教程,希望对你有帮助!
WPS表格快速隐藏不使用的区域的教程:
第一步,制作文档。
打开WPS表格 2009(在线文档公测版),新建一个空白文档,在一些区域输入数字,作为使用区域。
第二步,点击“工具”—“宏”—“创建”新宏。
第三步,在Microsoft Visual Basic中输入或复制下列代码。
Sub HiddenSurroundRange()
Dim CelFirst As Range, CelLast As Range
If Not Selection Is Nothing Then
With Selection
'当前选中区域的第一个单元格
Set CelFirst = .Cells(1)
'当前选中区域的最后一个单元格
Set CelLast = .Cells(.Cells.Count)
End With
If CelFirst.Address <> "$A$1" Then
'蓝色区域
With Range([a1], CelFirst.Offset(IIf(CelFirst.Row = 1, 0, -1), IIf(CelFirst.Column = 1, 0, -1)))
'如果当前选中区域不包括第一行,则隐藏蓝色区域所在的行
If CelFirst.Row <> 1 Then .EntireRow.Hidden = True
'如果当前选中区域不包括第一列,则隐藏蓝色区域所在的列
If CelFirst.Column <> 1 Then .EntireColumn.Hidden = True
End With
End If
f CelLast.Address <> "$IV$65536" Then
'与上面类似处理绿色区域
With Range(CelLast.Offset(IIf(CelLast.Row = 65536, 0, 1), IIf(CelLast.Column = 256, 0, 1)),
[IV65536])
if CelLast.Row <> 65536 Then .EntireRow.Hidden = True
If CelLast.Column <> 256 Then .EntireColumn.Hidden = True
End With
End IfEnd If
End Sub
第四步,执行“视图—工具—控件工具箱”,单击“按钮”,选择合适的位置插入一个悬浮的“隐藏”按钮,为它指定HiddenSurroundRange宏。
第五步,选定使用区域,点击“隐藏”按钮,使用区域以外的区域一次性全部隐藏。
小提示:WPS默认安装没有VBA环境,也无法使用宏功能,若要实现教程所述功能,需要另外安装VBA,WPSoffice在线文档公测版可以共享文档,只要有邮箱,就可以共享VBA文档,免去寻觅、下载之苦。另外,由于实例中运用了“宏”,在打开该文件时要启用宏。
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
WPS 2009怎样为文档添加背景
![](https://img.aspxhome.com/file/2023/4/a164134_0s.jpg)
word 查找的通配符使用技巧及实例教程
Excel中数字0如何设置不显示?
![](https://img.aspxhome.com/file/2023/1/a154001_0s.png)
word怎么打印小抄?word小抄排版缩印的方法
![](https://img.aspxhome.com/file/2023/3/28793_0s.jpg)
word自动编号老是出问题,是怎么回事?
![](https://img.aspxhome.com/file/2023/6/32296_0s.jpg)
excel2003自动求和计算方法
TSC条型码打印机WORD文档?
WPS演示2013中使用排练计时功能记录幻灯片的放映时间
![](https://img.aspxhome.com/file/2023/5/a169205_0s.jpg)
WPS文字打印设置教程
![](https://img.aspxhome.com/file/2023/7/a171177_0s.png)
Excel2010批注中文字插入的方法
![](https://img.aspxhome.com/file/2023/0/a141700_0s.png)
wps怎么制作弧形文字? wps文字弧形排列的教程
![](https://img.aspxhome.com/file/2023/3/a166143_0s.jpg)
Excel中IMLOG10函数的语法和用法
![](https://img.aspxhome.com/file/2023/2/a155772_0s.jpg)
word2007重新使用和分发文档部分
![](https://img.aspxhome.com/file/2023/0/20680_0s.gif)
Word文档中怎么插入分数
![](https://img.aspxhome.com/file/2023/0/17680_0s.jpg)
word格式刷在哪?如何使用?
![](https://img.aspxhome.com/file/2023/0/20310_0s.jpg)
win7升级win10会不会卡
![](https://img.aspxhome.com/file/2023/6/48606_0s.jpg)
解决word无法输入汉字问题
win10音量图标没反应?win10音量图标没反应要怎么处理呢?
![](https://img.aspxhome.com/file/2023/8/47388_0s.jpg)
迅捷在线PDF转word转换器的多种特点与详细使用图文步骤
![](https://img.aspxhome.com/file/2023/5/29155_0s.jpg)
excel如何恢复隐藏的列?excel恢复显示的几种常见方法
![](https://img.aspxhome.com/file/2023/4/42424_0s.jpg)