Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have the following running under a command button.
it works once and then the next time an error appears on the following line under Sh For Each Sh In wb.Worksheets 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 Any help please Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Default view of Excel to 75% | Excel Discussion (Misc queries) | |||
Userform - Printing | Excel Worksheet Functions | |||
Macro to simply bring up the Find dialogue box?? | Excel Discussion (Misc queries) | |||
Data Entry Alert in User Form | Excel Discussion (Misc queries) | |||
Check boxes to show/hide Tabs | Excel Worksheet Functions |