• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Hiding and unhiding worksheets using a single page of buttons

edbarton

New Member
Hi guys,

I am new to all this and I am trying to build a workbook with a title page that has buttons or shapes that link to each of the worksheets with in the workbook. I would like the sheets to be hidden until the button is clicked once the specific sheet is finished with I would like a back button to go back to home and close the worksheet again.

I have tried to achieve this by copying various code from this and other sites but nothing I try seems to work, i am obviously doing something wrong but tearing my hair out as I can't work out what...............ssssssssssssooooooooooooo frustrated please help. I would like to know the process as I would like to be able to add worksheets at a later date etc.

I have attached the workbook I have been working on.

Many many thanks
Ed
 

Attachments

vletm

Excel Ninja
edbarton
Why did You duplicate Your thread?
You had opened yesterday:
Now, I've to close that.
 

Marc L

Excel Ninja
Hi,​
as it's at beginner level I can't stand how can it be possible to not well read & copy any code​
but for sure coping / pasting can't be coding as it needs to warm at least a couple of neurons …​
As a first training : paste the below VBA procedure to the ThisWorkbook module of your attachment then once done​
select any tab different than Home tab then select the Home tab or use the Home button : the previous selected tab is now hidden.​
Code:
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
    If Sh.Index > 1 Then Sh.Visible = xlSheetHidden
End Sub
Do you like it ? So thanks to click on bottom right Like !​
 

edbarton

New Member
Hi,​
as it's at beginner level I can't stand how can it be possible to not well read & copy any code​
but for sure coping / pasting can't be coding as it needs to warm at least a couple of neurons …​
As a first training : paste the below VBA procedure to the ThisWorkbook module of your attachment then once done​
select any tab different than Home tab then select the Home tab or use the Home button : the previous selected tab is now hidden.​
Code:
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
    If Sh.Index > 1 Then Sh.Visible = xlSheetHidden
End Sub
Do you like it ? So thanks to click on bottom right Like !​
Thank you, that works well but the links don't open the hidden sheets.
 

S. Das

Active Member
Thanks S. Das that is exactly what I am looking for. how would I add additional buttons and worksheets.
You are welcome.
By the way, I don't understand your question about worksheet and button. You can add any shape as per your wish and after assign macro by right click on it you can use the shape as a button. Please refer the file I shared above. You can also get VBA code of hide and unhide of a sheet from the file.
 
Top