August 22, 2020

How to unhide all the hidden sheets at once - Microsoft Excel

 When working with big dashboards we hide lots of backend sheets so that final dashboard is clean.

The easy part if hiding multiple sheets, this can be done easily. But how to you unhide all sheets or specific sheets.

Below code will help you unhide all the sheets. hit Alt+F11. Go to Insert Menu -> "Module" and enter the below code.

Sub UnhideAllSheets()

'Unhide all sheets in workbook.
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
End Sub

But what if only few sheets needs to be unhidden. In these cases use the below code which will prompt you before unhiding a hide until the last hidden sheet.

Sub UnhideFewSheets()

'Unhide all sheets in workbook.
Dim ws As Worksheet
Dim question As VbMegBoxResult
For Each ws In ActiveWorkbook.Worksheets
If ws.Visible = xlSheetHidden then
Question = Msgbox("Do you want to Unhide" & ws.Name &"?", vbYesNo, "Sheets will be unhidden")

If Question = vbYes then ws.Visible = xlSheetVisible
End If

Next
End Sub

Thanks for visiting. If you have any questions reach out to me directly at askme.kkhelps@gmail.com

August 21, 2020

How to get contents from a Hidden sheet in a Protected workbook - Microsoft Excel

 When you have a Excel file which is protected and you have forgotten the password.

Now how do you retrieve the content from the hidden sheet?

There is a simple technique but the requirement is you should know the sheet name of hidden sheet or you VBA environment should not be password protected.

Lets assume the hidden sheet name is 'Sheet2'. To retrieve only the content from this sheet, all you have to do is write a A1 cell reference formula in a visible sheet like below. Now drag this to right and down as much as needed. Voila! you have the data from hidden sheet in front of you.

If you do not know the sheet name. Then hit Alt+F11, on the top left side you will see all the sheets of the current workbook. Based on your needs you can get the data from a hidden worksheet.

Again, this tip is not intended to be used in illegal ways but only in cases it is desperate need and there is no other option.

Thanks for visiting. If you have any questions reach out to me directly at askme.kkhelps@gmail.com

August 20, 2020

How to filter for multiple values in Microsoft Excel dashboard

 When it comes to dashboards in Excel, we rely on the data validation list predominantly to act as user inputs based on which the dashboard is calculated. But this approach doesn't enable the user to multi-select values from drop down nor there is other straight-forward way which makes the life of end user to create such functionality.

So given this case, how do we achieve this?

Well, we can use the form checkbox and a bit of VLOOKUP to get around this and have multi-selection in your dashboard.

Below are the steps which should help you achieve this. Before that lets define our end goal. 

Lets say we have to enable to the dashboard to show total sales of fruits by month and the user needs to have a functionality of selecting single/multiple months.

Step1: Below is the data we are working with.

Step2: Lets have a simple table like below which should calculate sales based on dynamic month selection.

Step3: Enable the DEVELOPER tab on the ribbon above. If already enable skip step 3.

Click on 'More Commands'  in the 'Customize Quick Access toolbar' menu. Now 'Customize Ribbon'. Select the 'DEVELOPER' on the right-most slide and click OK.  

  

Step4: From the developer tab insert a checkboxes as shown below and name it with the months you have in your data.

Step5: Right click on each of these checkboxes(go to FORMAT CONTROL) and link them to a cell. So that when you CHECK the checkbox the cell should show "TRUE".

Step6: Like shown below. Enter an IF condition to display the relevant month if relevant checkbox is selected adjacent to the linked cell.

=IF(F5,"JAN","")

When you select a month only those months should appear next to linked cells.

Step7: In the data which I mentioned in step1, add a column "MONTH DYNAMIC" and enter the below formula. So that if searches if the month in the line is available next to linked cells. Now apply the formula to all lines in the data. Now you see only months selected are populating in the data.

=IFERROR(VLOOKUP(K4,$G$4:$G$10,1,0),"")

  

Final step: Enter the below formula in the table shared on step 2. Apply to all rows.

=SUMIFS($M:$M,$N:$N,">""",$L:$L,C8)

Now the table populates data based on which months you select from the checkboxes.

A copy of the file used in the above steps can be downloaded HERE

Thanks for visiting. If you have any questions reach out to me directly at askme.kkhelps@gmail.com