Excel精英培训网

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

[已解决]再求助雪舞子:老师:您好! ...

[复制链接]
发表于 2016-1-16 20:24 | 显示全部楼层 |阅读模式
再求助雪舞子:老师:您好!还有个问题要请您赐教!也就是《数据》工作簿的保存格式是.rar (27.31 KB, 下载次数: 6)
发表于 2016-1-16 21:16 | 显示全部楼层    本楼为最佳答案   
  1. Sub test()
  2.     Application.DisplayAlerts = False
  3.     Application.ScreenUpdating = False
  4.     On Error Resume Next
  5.     Set th = ThisWorkbook
  6.     Set wk = Workbooks.Open(th.Path & "" & "数据")
  7.     With wk
  8.         For Each sh In .Worksheets
  9.             If Not th.Sheets(sh.Name) Is Nothing And th.Sheets.Count > 1 Then
  10.                 th.Sheets(sh.Name).Delete
  11.             Else
  12.                 th.Sheets(sh.Name).Name = "temp"
  13.             End If
  14.             .Sheets(sh.Name).Copy After:=th.Sheets(th.Sheets.Count)
  15.             If sh.Name <> "目录" Then
  16.                 With th.Sheets(sh.Name)
  17.                     .Rows("2:3").Delete
  18.                     .Columns("G:I").Delete
  19.                     .Range("g2") = "备注"
  20.                 End With
  21.             End If
  22.         Next
  23.         .Close False
  24.     End With
  25.     If Not th.Sheets("temp") Is Nothing And th.Sheets.Count > 1 Then
  26.         th.Sheets("temp").Delete
  27.     End If
  28.     Application.ScreenUpdating = True
  29.     Application.DisplayAlerts = True
  30. End Sub
复制代码
复制.rar (18.53 KB, 下载次数: 12)

评分

参与人数 1 +3 收起 理由
水木 + 3 很给力

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-25 14:38 , Processed in 0.143010 second(s), 12 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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