CodePudding user response:
Can only copy its content, other don't do any operation, don't show the operation of the open the ExcelCodePudding user response:
Excuse me, is the job of the name with aa tableCodePudding user response:
Write well, code is as follows:
Sub test ()
Dim wb As Workbook
The Set wb=Application. Workbooks. Open (" d: \ WDXX \ hi555 XLSX ")
Dim SHT As Worksheet
For Each SHT In wb. Worksheets
If InStr (SHT) Name, "aa") & gt; 0 Then
SHT. Cells. Copy
Dim sht2 As Worksheet
The Set sht2=ThisWorkbook. Sheets. The Add (After:=ThisWorkbook. Sheets (ThisWorkbook. Sheets. Count))
Sht2. Name=SHT. Name
Sht2. Cells. PasteSpecial
Application. CutCopyMode=False
End the If
Next
Wb. Close
End Sub
Run the example:
Download address:
Link: https://pan.baidu.com/s/1zERGOXPclUPHNAifLQgtYA
The extracted code: j0de
CodePudding user response:
CodePudding user response:
What code heavy start, just use the means of recording macros, operating your want, then slowly to optimize and measure program. I do it.