How to select all sheets except one in Excel?
We can apply the Select All Sheets feature to select all sheet tabs of a workbook, but, do you have any ideas to select all sheets except the specific one in Excel?
To select all tabs except specific one, the following VBA code can help you, please do as this:
1. Hold down the ALT + F11 keys, then it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Select all sheets except one:
Sub selectallbutone() 'Updateby Extendoffice Dim x As Long Sheet1.Select For x = 2 To ThisWorkbook.Sheets.Count If Sheets(x).Name <> "Sheet5" Then Sheets(x).Select Replace:=False Next x End Sub
Note: In the above code, Sheet5 is the sheet name that you want to exclude when selecting all sheets, please change it to your need.
3. And then press F5 key to run this code, and all sheet tabs have been selected except the specific one, see screenshot:
Best Office Productivity Tools
Supercharge Your Spreadsheets： Experience Efficiency Like Never Before with Kutools for Excel
Kutools for Excel boasts over 300 features, ensuring that what you need is just a click away...
Supports Office/Excel 2007-2021 & newer, including 365 | Available in 44 languages | Enjoy a full-featured 30-day free trial.
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!