M
mark
I have the following macro running in a workbook.
the problem i have with this is that when it creates the
new workbook with certain sheets missing, it changes the
orignal to the new workbook
can anyone help
Private Sub CommandButton1_Click()
Dim wb As Workbook
'copy all sheets
Worksheets.Copy
Set wb = ActiveWorkbook
Application.DisplayAlerts = False
'delete the sheets you want
wb.Sheets(Array("Suspense", "RCA exc RIM", "Operations
summary", "RCA incl RIM", "First Qtr", "Second
Qtr", "Third Qtr", "Fourth Qtr")).Delete
Application.DisplayAlerts = True
For Each Sh In wb.Worksheets
Sh.Columns("A:B").EntireColumn.Delete
Next
End Sub
the problem i have with this is that when it creates the
new workbook with certain sheets missing, it changes the
orignal to the new workbook
can anyone help
Private Sub CommandButton1_Click()
Dim wb As Workbook
'copy all sheets
Worksheets.Copy
Set wb = ActiveWorkbook
Application.DisplayAlerts = False
'delete the sheets you want
wb.Sheets(Array("Suspense", "RCA exc RIM", "Operations
summary", "RCA incl RIM", "First Qtr", "Second
Qtr", "Third Qtr", "Fourth Qtr")).Delete
Application.DisplayAlerts = True
For Each Sh In wb.Worksheets
Sh.Columns("A:B").EntireColumn.Delete
Next
End Sub