Excel精英培训网

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

[已解决]VBA只保留两列B和E列,其它全部删除如何

[复制链接]
发表于 2016-6-14 17:09 | 显示全部楼层 |阅读模式
VBA只保留两列B和E列,其它全部删除如何
最佳答案
2016-6-14 20:06
  1. Sub xx()
  2.     Cells.Select
  3.     Selection.EntireRow.Hidden = False
  4.     Columns("B").Hidden = True
  5.     Columns("E").Hidden = True
  6.     Cells.SpecialCells(xlCellTypeVisible).Select
  7.     Selection.Clear
  8.     Columns("B").Hidden = False
  9.     Columns("E").Hidden = False
  10. End Sub
复制代码
发表于 2016-6-14 20:06 | 显示全部楼层    本楼为最佳答案   
  1. Sub xx()
  2.     Cells.Select
  3.     Selection.EntireRow.Hidden = False
  4.     Columns("B").Hidden = True
  5.     Columns("E").Hidden = True
  6.     Cells.SpecialCells(xlCellTypeVisible).Select
  7.     Selection.Clear
  8.     Columns("B").Hidden = False
  9.     Columns("E").Hidden = False
  10. End Sub
复制代码
回复

使用道具 举报

 楼主| 发表于 2016-6-15 09:03 | 显示全部楼层
老司机带带我 发表于 2016-6-14 20:06

乱写反正不看
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-3-29 08:07 , Processed in 0.342038 second(s), 9 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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