W.E.B
asked on
Excel Macro
Hello,
Can you please help,
I'm using below code to save sheets to new workbook.
the problem I have is, the sheet names are not always the same.
how can I change the code below to say,
Copy All sheets except "Main_Sheet"
Sub Export()
Dim wb As Workbook, InitFileName As String, fileSaveName As String
InitFileName = ThisWorkbook.Path & "\ - Recon_Output_ " & Format(Date, "yyyymmdd")
Sheets(Array("SheetM1", "SheetMG1", "SheetHM1", "SheetJM1", "SheetK1", "SheetO1", "SheetL1", "SheetJY91")).Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "C:\Users\Wassim\Desktop\t est)
.Close False
End With
Range("A1").Select
ActiveWorkbook.SAVE
End Sub
Any help is appreciated,
Thanks
Can you please help,
I'm using below code to save sheets to new workbook.
the problem I have is, the sheet names are not always the same.
how can I change the code below to say,
Copy All sheets except "Main_Sheet"
Sub Export()
Dim wb As Workbook, InitFileName As String, fileSaveName As String
InitFileName = ThisWorkbook.Path & "\ - Recon_Output_ " & Format(Date, "yyyymmdd")
Sheets(Array("SheetM1", "SheetMG1", "SheetHM1", "SheetJM1", "SheetK1", "SheetO1", "SheetL1", "SheetJY91")).Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "C:\Users\Wassim\Desktop\t
.Close False
End With
Range("A1").Select
ActiveWorkbook.SAVE
End Sub
Any help is appreciated,
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER