Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Macro that unhides a sheet and takes the user to that sheet

Hello,

I have a macro on sheet 'inputs' that unhides another sheet called
'calculations' and takes the user there from when they click on the button.
The codes is as follows:

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

This works well but I would now like to add a feature. I would like the same
button to take the user from the 'inputs' sheet to the 'calculations' sheet
even if the sheet is already revealed. How could I do this?

Thanks very much in advance!

--

Johanna
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Macro that unhides a sheet and takes the user to that sheet

Try

Sub Reveal()
With Worksheets("Calculations")
If .Visible = False Then .Visible = True
.Activate
End With
End Sub

--
Jacob


"Johanna Gronlund" wrote:

Hello,

I have a macro on sheet 'inputs' that unhides another sheet called
'calculations' and takes the user there from when they click on the button.
The codes is as follows:

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

This works well but I would now like to add a feature. I would like the same
button to take the user from the 'inputs' sheet to the 'calculations' sheet
even if the sheet is already revealed. How could I do this?

Thanks very much in advance!

--

Johanna

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Macro that unhides a sheet and takes the user to that sheet

That was very helpful and quick again Jacob. Thank you so much for your
continuing support.

--
Johanna


"Jacob Skaria" wrote:

Try

Sub Reveal()
With Worksheets("Calculations")
If .Visible = False Then .Visible = True
.Activate
End With
End Sub

--
Jacob


"Johanna Gronlund" wrote:

Hello,

I have a macro on sheet 'inputs' that unhides another sheet called
'calculations' and takes the user there from when they click on the button.
The codes is as follows:

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

This works well but I would now like to add a feature. I would like the same
button to take the user from the 'inputs' sheet to the 'calculations' sheet
even if the sheet is already revealed. How could I do this?

Thanks very much in advance!

--

Johanna

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run macro when user selects a different sheet CraigKer Excel Programming 3 March 13th 09 12:46 PM
Macro that unhides sheet tabs Sunnyskies Excel Discussion (Misc queries) 4 June 14th 08 07:49 PM
macro that takes data entered in a user form textbox to go to a ra BrianMo Excel Programming 5 September 22nd 06 03:52 PM
TAB key takes cursor to other end of sheet... Nat Excel Discussion (Misc queries) 2 April 10th 06 08:05 PM
Help with Macro. -- User input for sheet name Michael A Excel Programming 9 January 6th 06 03:17 PM


All times are GMT +1. The time now is 09:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"