Hide Sheets by Report User

linesy

Board Regular
Joined
Sep 27, 2004
Messages
72
Hi,

I developed some pivot table reports and macro'd out pdf'ing them for the users but now management want the users to be able to manipulate the data themselves !! The file is 31 sheets and I'm figuring they'll only want to see the sheets that are relevant to them so is there a way to macro it out?? Perhaps when the file opens it asks, "Who do you want to see?" Jack? Joe? or Rudy?, Month or YTD, or Both? or Everything? and it will hide the sheets that are not selected. The words "month" and "YTD" is in Cell "N1" and the individuals names are in Cell "M1".

This would be a great help and cut down on the filtering through sheets.

Thanks so much :)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Just a thought but it might make the process easier if you were able to condense the sheets down by putting month and ytd pivot table reports into the same sheet. In fact, pivot tables have a very useful function where you can group by dates so that you can show all of the months grouped together.

If you could do that, you might then create a inputbox with vba attached to a button that when the user clicks on it, they can put in their name and then all of the sheets not needed will be hidden.

I can tinker around with some code for you. Confirm whether you can consolidate the sheets first.
 
Upvote 0
another way to consider would be...using Select Case and having the user enter their name, and based on that name, hide / unhide certain sheets
 
Upvote 0
Thanks Jakeman. So I've managed to consolidate the sheets down, thanks for the suggestion. Can you tinker for me :D
 
Upvote 0
Thanks Jakeman. So I've managed to consolidate the sheets down, thanks for the suggestion. Can you tinker for me :D

try this:

Code:
Sub HideAllSheetsButOne()
Dim sht As Object
Dim sheetName As String

sheetName = InputBox("Please enter Sheet name that you want to see: (Jack, Joe, Rudy)")


For Each sht In Sheets
If sht.Name <> sheetName Then
sht.Visible = xlSheetHidden
End If
Next sht

End Sub
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,657
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top