|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub test()
Dim strFileName$, strPath$, wks As Worksheet, ar(), r&
Application.ScreenUpdating = False
strPath = ThisWorkbook.Path & "\"
For Each wks In Sheets
If wks.Visible = True Then
r = r + 1
ReDim Preserve ar(1 To r)
ar(r) = wks.Name
End If
Next
strFileName = strPath & Cells(1, 22)
Sheets(ar).Copy
With ActiveWorkbook
.SaveAs strFileName
.Close
End With
Application.ScreenUpdating = True
Beep
End Sub |
评分
-
1
查看全部评分
-
|