Kutools for excel license name and code install#
Y ou can easily remove all sheets except current active sheet with just one click by Delete All Inactive Sheets utility of Kutools for Excel.īefore applying Kutools for Excel, please download and install it firstly.ġ.
Kutools for excel license name and code code#
For example, for keeping sheet1 in current workbook, you need to change the sixth line code to: If xWs.Name "Sheet1" Thenĭelete all sheets except current active one with Kutools for Excel (One click only) If you just want to keep one sheet and delete all from the workbook, please remove all Andcondition in the code. If xWs.Name "Sheet1" And xWs.Name "Sheet2" And xWs.Name "your sheet name" Thenģ. If you want to delete all but keep more sheets, please add code And xWs.Name " your sheet name" before the Then word in the sixth line of the code. You can change them based on your needs.Ģ. “ Sheet1” and “ Sheet2” are sheets you want to keep in current workbook. If xWs.Name "Sheet1" And xWs.Name "Sheet2" Thenġ. VBA code: Delete all sheets except specified ones Sub DeleteSheets1()įor Each xWs In Click Insert > Module, then copy and paste below VBA code into the Module window. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic Application window.Ģ. With below VBA code, you can delete all sheet in a workbook except specific one in Excel.ġ. One click to delete all sheets except current active one with Kutools for Excel How to delete all sheets except specified/current one in Excel?įor deleting all sheets in an Excel workbook except specified one or current active sheet, you can deal with this as below methods shown.ĭelete all sheets except specified one with VBA code