See how simple it is? You can customize it as I have above, by changing what the tab is called. Private Sub Worksheet_Activate() Dim sheet As Worksheet Application.ScreenUpdating = False If ShowHide.Name = "Show My Guts" Then 'Make all sheets visible For Each sheet In ThisWorkbook.Sheets sheet.Visible = xlSheetVisible Next sheet 'Change the sheet name to the "Collapse" name you want ShowHide.Name = "Hide My Guts" 'Pick a sheet to display after the once hidden sheets are expanded Sheet4.Activate Else 'Hide all sheets except the ones you want to keep visible For Each sheet In ThisWorkbook.Sheets If (sheet.Name Results.Name And sheet.Name Run.Name And sheet.Name ShowHide.Name) Then sheet.Visible = xlSheetVeryHidden End If Next sheet 'Change the sheet name to the "Expand" name you want ShowHide.Name = "Show My Guts" 'Pick a sheet to display after the sheets to be hidden are collapsed Run.Activate End If Application.ScreenUpdating = True End Sub
#Challenging expand and condense logarithms worksheet code
However, there is no Visual Basic for Applications (VBA) support in Excel 2008 for Mac, so this code cannot be used there. It has been tested and confirmed to work in Excel 2000 upwards, and Excel 2004 on an Apple Mac. Now you can go back to the main Excel window and test it out. Make sure you edit the copied code so that the names of sheets refer to the sheets in your workbook. You then copy the code below and paste it into that page. This will bring up a blank page for this sheet's code. Next, in the list of sheets in the left pane, double click the sheet that you will be using as an expand/collapse tab. To add the code, you'll need to open up the VBA Project Manager (Alt+F11). All you need to do is create a new sheet that will serve only as a button tab, hide all the cells within it (to avoid a flickering effect), and add code to its 'Worksheet Activate' event that will show or hide a bunch of sheets, and then activate another sheet at the end.
I've been using it for 5 years now and every client I show it to is delighted by the concept. This idea is incredibly effective and surprisingly easy to implement.
Turning a Sheet Tab into an Expand/Collapse Button.Ĭheck out what happens when you switch to the tab that says "Show My Guts" (expand): And now:Ĭlick the tab again (notice that the name has changed), and the expanded tabs collapse and become hidden again. What you could really use, is an expand/collapse button. You could hide all the unnecessary sheets, but this can be cumbersome for developers, and can confuse advanced users. Often, you don't want these showing up all the time, since the main program might be run using just one or two sheets. Often, when the program is done, you find that many of these sheets are just used for driving the workbook, containing data tables, intermediary calculations, or advanced configuration parameters. Many projects you may work on in Excel might develop the problem of having a huge number of sheets. In the next examples, we will solve some problems involving pH.There are too many sheets in this workbook Taken together, the product rule, quotient rule, and power rule are often called “properties of logs.” Sometimes we apply more than one rule in order to expand an expression. Condense a logarithmic expression into one logarithm.Expand a logarithm using a combination of logarithm rules.