这段代码是把一些工作表提取出来放在新的工作簿并保存,我希望能改成把这些工作表都保存在同一个工作簿里,请问要怎么改呢
Private Sub CommandButton5_Click()
Dim Sht As Worksheet
Dim FilePath As String
FilePath = ThisWorkbook.Path & "\"
Application.ScreenUpdating = False
For Each Sht In ThisWorkbook.Sheets
Dim xm As String
xm = userform2.ComboBox3.Text
If Sht.Name Like xm & "*" Then
With Sht
.UsedRange.Value = .UsedRange.Value
.Copy
End With
With ActiveWorkbook
.SaveAs Filename:=FilePath & Sht.Name
.Close
End With
End If
Next Sht
Application.ScreenUpdating = True
MsgBox "导出完成"
End Sub