|
楼主 |
发表于 2020-5-17 22:55
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 副本仅存数据和格式()
Dim bs%, nm, snum%
Application.ScreenUpdating = False
snum = Application.SheetsInNewWorkbook
bs = ThisWorkbook.Sheets.Count
nm = ThisWorkbook.Name
Application.SheetsInNewWorkbook = bs
With Workbooks.Add
For i = 1 To bs
With .Sheets(i)
ThisWorkbook.Sheets(i).UsedRange.Copy
With .Range("a1")
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteColumnWidths
.Range("a1").PasteSpecial xlPasteFormats
' 怎样去掉条件格式,根据表的实际自己加代码改一下吧。
End With
.Name = ThisWorkbook.Sheets(i).Name
End With
Next
.Close True, ThisWorkbook.Path & "\" & "一条流" & nm
End With
Application.SheetsInNewWorkbook = snum
Application.ScreenUpdating = True
End Sub
老师 我从网上复制一段VBA代码能够实现了, 但是保存后找不到文件路径, 能帮看看,哪里是修改保存路径的吗? |
|