ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to unhide a sheet Excel 2007 (https://www.excelbanter.com/excel-programming/435008-macro-unhide-sheet-excel-2007-a.html)

Paula

Macro to unhide a sheet Excel 2007
 
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!

tkmaster3

Macro to unhide a sheet Excel 2007
 
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.


--
~TK~


"Paula" wrote:

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!


tkmaster3

Macro to unhide a sheet Excel 2007
 
Sorry I meant to say "Enrollment 2", and not 1, in the formulas.


--
~TK~


"Paula" wrote:

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!


Jeanette[_2_]

Macro to unhide a sheet Excel 2007
 
On 15 Oct, 21:05, Paula wrote:
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

Paula

Macro to unhide a sheet Excel 2007
 
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!

"tkmaster3" wrote:

Sorry I meant to say "Enrollment 2", and not 1, in the formulas.


--
~TK~


"Paula" wrote:

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!


Patrick Molloy[_2_]

Macro to unhide a sheet Excel 2007
 
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?

"Paula" wrote:

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!

"tkmaster3" wrote:

Sorry I meant to say "Enrollment 2", and not 1, in the formulas.


--
~TK~


"Paula" wrote:

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!


Paula

Macro to unhide a sheet Excel 2007
 
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

"Patrick Molloy" wrote:

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?

"Paula" wrote:

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!

"tkmaster3" wrote:

Sorry I meant to say "Enrollment 2", and not 1, in the formulas.


--
~TK~


"Paula" wrote:

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!


Paula

Macro to unhide a sheet Excel 2007
 
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

"Jeanette" wrote:

On 15 Oct, 21:05, Paula wrote:
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
.


Dave Peterson

Macro to unhide a sheet Excel 2007
 
I think you're going to have to share what went wrong...

Paula wrote:

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

"Jeanette" wrote:

On 15 Oct, 21:05, Paula wrote:
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
.


--

Dave Peterson

Paula

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

"Dave Peterson" wrote:

I think you're going to have to share what went wrong...

Paula wrote:

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

"Jeanette" wrote:

On 15 Oct, 21:05, Paula wrote:
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
.


--

Dave Peterson
.



All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com