Macro to unhide a sheet Excel 2007

P

Paula

When in worksheet "Enrollment 1", I have a button to click. I need to assign
a macro to it (i know how to do that part) to open the next hidden worksheet
"Enrollment 2", but I cannot find the correct macro to say open or activate
"Enrollment 2". Thanks!
 
T

tkmaster3

Attach this macro to your button

Sub Show_Enrollment 1_Tab_Macro()

Sheets("Enrollment 1").Visible = True

End Sub


If you want to cursor to go to the Enrollment 1 and into say cell A1 use this:

Sub Show_Enrollment 1_Tab_Macro()

Sheets("Enrollment 1").Visible = True
Sheets("Enrollment 1").Select
Range("A!").Select

End Sub


Hope this works out for your needs.
 
J

Jeanette

When in worksheet "Enrollment 1", I have a button to click.  I need to assign
a macro to it (i know how to do that part) to open the next hidden worksheet
"Enrollment 2", but I cannot find the correct macro to say open or activate
"Enrollment 2".  Thanks!

Hi Paula

Try this

Private Sub Reveal()
With ThisWorkbook
If Worksheets("Enrollment 2").Visible = False Then
Worksheets("Enrollment 2").Visible = True
Worksheets("Enrollment 2").Activate
End If
End With
End Sub

HTH Jeanette
 
P

Paula

Hi-I tried that, but not working. I am sure it is user error, but cannot
figure out why not working. Here is the macro:

Sub Macro13()
Sub Show_Enrollment 2_Tab_Macro()

Sheets("Enrollment 2").Visible = True

End Sub

Thanks!
 
P

Patrick Molloy

is the code in a standard MODULE?
put
OPTION EXPLICIT
at the very top of the module, so its the very first line

if the code isn't in a module, then cut/paste into one. With the procedure
selected, step through is with the F8 key

are there any error messages?
 
P

Paula

I tried that, but did not work. It opens Enollment 2 if not hidden, but will
not open hidden sheet. I do not know what a "Satndard Module" is. I fo to
'View Macros', they are all listed there, I start a new one. Please don't
give up on me.
Paula
 
P

Paula

I tried this-won't work. Please treat me like the moron I am. Tell me how
to do it as if I have never done a macro before. I am missing something.
Thanks! Paula
 
P

Paula

I figured it out-I had a Hyperlink attached to the button I had to remove,
then it worked. Thanks ALL!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top