Hide Sheet

Hi,

Intent to hide  "Menu" sheet in the attached workbook, and the sheet only open when click "Open Sheet Button". The sheet back to hidden when user click  "Data' Sheet. Hope Expert could help create this macro. Attached the workbook.
HideSheet.xls
Billa7Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hitsdoshi1Commented:
There you go.... I have made the button working.....if you open vba then you will see I created sub hideunhide()

Good Luck!
HideSheet.xls
0
Billa7Author Commented:
HI hitsdoshi1:

Need help. How to modify the code if I replace the button with picture (e.g. Picture 8)?
0
dlmilleCommented:
Just right click the picture and hit "Assign Macro" and select that macro that hisdoshi1 provided.

Dave
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Billa7Author Commented:
Hi Dave,

I've tried, but it shows an error message "the item with the specified name was not found" at this line:
Sheets("Data").Shapes("Button 1").Select  
0
Billa7Author Commented:
Hi,

Attached the workbook, replaced button with a picture.
HideSheet.xls
0
wchhCommented:
Amended Macro as follow:
Sub hideunhide()
'Sheets("Data").Shapes("Button 1").Select
'If Selection.Characters.Text = "Open Sheet" Then
If Not Sheets("Menu").Visible Then '<-- Insert
    Sheets("Menu").Visible = True
    'Selection.Characters.Text = "Hide Sheet"
    'ActiveSheet.Range("A1").Select
    'Sheets("Menu").Select
Else
    'Selection.Characters.Text = "Open Sheet"
    Sheets("Menu").Visible = False
    'ActiveSheet.Range("A1").Select
End If
End Sub

Open in new window

0
dlmilleCommented:
this is a bit simpler...

Sub hideunhide()
    Sheets("Menu").Visible = Not Sheets("Menu").Visible
End Sub

see attached.

Cheers,

Dave
HideSheet.xls
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Billa7Author Commented:
Hi,

Thanks a lot for the help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.