Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 2298|回复: 2

[已解决]包含指定字符的列隐藏

[复制链接]
发表于 2016-3-30 06:56 | 显示全部楼层 |阅读模式
利润表列隐藏.zip (17.77 KB, 下载次数: 18)
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2016-3-30 09:11 | 显示全部楼层    本楼为最佳答案   
  1. Sub 隐藏()
  2.     Dim j%, jmax%
  3.     jmax = [b5].End(2).Column
  4.     For j = 2 To jmax
  5.         If InStr(Cells(5, j), "%") > 0 Or InStr(Cells(5, j), "差额") > 0 Then
  6.             Cells(5, j).EntireColumn.Hidden = True
  7.         End If
  8.     Next
  9. End Sub
  10. Sub 取消隐藏()
  11.     Dim j%, jmax%
  12.     jmax = [b5].End(2).Column
  13.     Range(Cells(5, 2), Cells(5, jmax)).EntireColumn.Hidden = False
  14. End Sub
复制代码

利润表列隐藏.rar

23.34 KB, 下载次数: 14

回复

使用道具 举报

 楼主| 发表于 2016-3-30 18:50 | 显示全部楼层
sry660 发表于 2016-3-30 09:11

谢谢。另外可否给做在一个切换按钮上?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-6 08:19 , Processed in 0.266221 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表