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
0
Utf
2/3/2010 9:59:01 AM
excel.programming 6508 articles. 2 followers. Follow

2 Replies
829 Views

Similar Articles

[PageSpeed] 36

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
0
Utf
2/3/2010 10:06:01 AM
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
0
Utf
2/3/2010 10:10:01 AM
Reply:

Similar Artilces:

Macro Button Question
Heya All, I am trying to insert and delete rows using macros. Ive assigned the Macro to a button, but would like to be able to insert (and delete) exactly where the button is on the worksheet, no matter where the activecell is.. So, I guess my question is, is it possible to get the cell reference behind a graphic button? Or, even better, assign a macro to a cell? ta, Maria Maria There are "insert row" and "insert column" buttons available from Tools>Customize>Commands>Insert Also "delete row" and "delete column" buttons available from To...

Macro to break up a csv file
Please help This is a few lines of a csv file that I have. I have it open in an Excel workbook. I need to write/record a macro that creates a new worksheet and cuts and pastes the data into them at every line that contains an 'R' on the left hand side. The amount of rows that contain data after the 'R' row are variable throughout the file. Thank you. H 11/12/2003 08:00:12 R 7926 1601 N B 11/12/2003 11/12/2003 10:15 L BX10A T10 2 18 6 L BX10A T10 5 71 29 L T20 43 63 22 L T21 BM 9 1 L T21 MB 6 1 ...

Unhiding rows
In Excel 2000, someone has hid the first 45 rows of the worksheet. I can't unhide them. The sheet is NOT protected. I tried various things including Edit/Go to/A1/Format/Row/Unhide but nothing works. Any clues? .......Baffled in Ontario row height? -- Don Guillett SalesAid Software Granite Shoals, TX donaldb@281.com "Connie" <marverncon@hotmail.com> wrote in message news:0b4001c35c24$077545d0$a601280a@phx.gbl... > In Excel 2000, someone has hid the first 45 rows of the > worksheet. I can't unhide them. The sheet is NOT > protected. I t...

Macro do delete values in cells
If I tipe a value (text) in N I want the values in the same row in O P & A to be deleted. Please help ...

SIMPLE MACRO!!!
I would like to write a macro in Excel that moves the cursor down one row, and then over to column J. I assume I am mixing a relative reference with an absolute referance so that moving one row down is relative, and moving over to column J is absolute. I tried writing a macro where I entered the "home" key (which took me to the beginning of the row), then one arrow key down (which obviously took me one row down), and then the right arrow key nine times (which landed me in column J where I wanted to be). I tried the macro in relative and absolute mode, but the mixing of the ...

Protect sheet help
I have a worksheet was setup to allow users to edit certain ranges when worksheet is protected. I deleted one of the ranges which users should not edit it anymore from the “Allow Users Edit Ranges…” window; however, the deleted range was editable even when the worksheet was protected. Just to experiment, I deleted all ranges from the “Allow Users Edit Ranges…” window, therefore, users should not be able to edit the entire worksheet when the worksheet is protected, and however, I was able to edit all ranges that were pervious setup to allow users to edit. Any ideas? Check that the cells are...

Combining data from multiple sheets
I have been using OmniPage 12 to scan columnar data and then export it to Excel. So far I have had reasonable success with the OCR formatting but when exporting the data, each scanned sheet becomes a sheet in Excel. I want all the data on one sheet so that I can manipulate it (sort, pivot, etc.). I have had no luck with help at the OmniPage bulletin board so I thougt, alternatively, is there a way to combine data from multiple sheets that would be simpler than copy/paste. Hi Ron - Have you tried going from the other direction? If OmniPage allows you to save the files as Text (I beli...

running a Macro in 2007 which was created in 2003
Hi there, I hope you can help, I am not VB literate unfortunately but I am trying to run a macro with the following line of code which creates an error: LastRow = Master_Wksht.Range("N" & Rows.Count).End(xlup).Row Is there a change between versions which means this line won't work any more? Simon, That line is fine in E2007 provided you have 'SET' Master_Wksht but if you hadn't done that it wouldn't have run in earlier versions of Excel Set Master_Wksht = Sheets("Sheet1") What have you dimmed LastRow as it should be long. ...

Macro to open non-Visio document on double-click
When I double-click an object in my flowchart I would like to open up a Word document or an Excel Document, but I can't see that there is an easy way to do this. Looking under the Double-Click behavior of a shape I see that I can assign a macro to run upon double-click, but I don't know how to create a new one. Can I create a macro or Visual Basic script in the Standard version of Vision that I have which would perform the "Open Document" task that I need done? visio's integration with M$ office is a common desire. there are a couple of good examples on how to ...

Deploying Macros with Exchange Server 5.5
Ok, now that I have my macro written, I need to deploy it to about 60 workstations without having to go to each one. I am running Exchange Server 5.5. Any ideas? Thanks! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Does anyone know where the vba code in outlook is actually stored on th hard drive? Maybe we could just copy the code to all of th computers.. ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and ...

User Frequency Report
Is there a way to get a user frequency report in Exchange 2000? I need to determine what users are not using their email to be disabled. Thanks! ...

This delegate takes ParameterizedThreadStart takes an object but can be called wirhout parameter
Hi! The delegate ParameterizedThreadStart is declared as taking one parameter of type object and returning void like this public delegate void ParameterizedThreadStart(Object obj) So according to the delegate the method signature should be void ParameterizedThreadStart(Object obj) In this example when I use the method ThreadWorkWithParam which is based on the delegete ParameterizedThreadStart and look like this private static void ThreadWorkWithParam(object param) { .. . . } I call the method ThreadWorkWithParam without passing a argument I just call is like this t1.Start...

Excel creating 'backup' version of my sheet...
Hi, a user noticed that one of his sheets is creating backup-copies by itself... - He deletes the backup version - opens the original sheet - change something - saves the original sheet - closes the original sheet tadaaaaa.... now a new file with 'name backup.xls' is created... He told me that he noticed this behaviour when he was 'protecting' his sheet by a password. Now we moved to Office2007 and he wants to get rid of this behaviour. Any suggestions? (btw, no add-ins are installed!) FOUND, Seems there is an extra checkbox, hidden in the tools options in 'Save...

Need to verify cell location before running a macro, how?
I am requesting users to click on a cell in column B (in which they are actually selecting a row of reference information), then to click on an icon which launches a macro that runs relevant to the row selected in column B. I would like Excel to verify that the selected cell is actually in column B prior to running the macro. If a cell in column B is not selected, I want to present a pop up message reminding them to select a cell in column B. Please help! If ActiveCell.Column <> 2 Then MsgBox "Don't Do That" Exit Sub End If -- Jim Cone Portland, Oregon USA http:...

assing macro to an an image, shape, text in Word 2007
I would like to run one of my macros when either an image, or a shape, or a text is clicked in Word 2007 document. Thanks, Use an ActiveX control, as they have a _Click event. Lev wrote: >I would like to run one of my macros when either an image, or a shape, or a >text is clicked in Word 2007 document. >Thanks, -- Gerry Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/word-programming/201004/1 Another method is to insert a MacroButton field and paste the image into the field code where the display text would be. See http://www.word...

How do I copy only subtotals to a new sheet?
Not including selecting each one individually. Select the range, press F5, select special and visible cells only, copy and paste Regards, Peo Sjoblom "darlinvee" wrote: > Not including selecting each one individually. Hi The way I do it is to set the grouping to display just the totals. Hit F5 and from Special select visible cells. Copy and Edit|Paste Special|Values where you want them to go! Andy. "darlinvee" <darlinvee@discussions.microsoft.com> wrote in message news:96DBD597-C934-4198-8407-370DB3369593@microsoft.com... > Not including selecting ...

How to Edit the Macro that exists behind an existing Command Butto
Hi There, Hoping someone can help me out ... I have inherited the task of managing an Access 2007 application. Within this application I have an Access 2007 form that has a Command Button. I'm not sure how this Command Button was created (Macro, Query, etc.) but I do know what it does. I would like to edit the Query/Macro this Command Button executes. I'd rather not edit the VBA coding as I am a VBA Beginner. Can you pleae let me know how I can edit the Command Button's Query/Macro. Thank you, Jason A command button can run a macro or a VB event proce...

Publisher files stop responding taking full resources of sysem.
While trying to open the copied version of the technical- manual, the system stops responding and shows up exhausting most of the system resources. the error that occurs occasionally is Error:-> System is not responding. The same does not happen with the original copy of the manual which works fine. Both of these contain some text and some graphics and the second one (copy) is having a few more graphics. It happens everytime when I create Publication of such kind and then save as another copy of it. The problem only occurs with the copied version. Please help as it just do...

export/import users grant between pcs
hi i want to export users grant from one pc and import to other pc . users are many. how can i do please help me ...

can't resolve user names
i've just added exchange 2003 to a small business server 2003 network. The users were already apart of the domain. My problem is that i want to add them to the exchange server and i can not get them connected because when i hit check name it never checks out correctly. am i missing something. This is a fresh first install of exchange and i can get the administrator account to get email. I just can't get it to work on any users. In news:OGRukk%23QGHA.4608@tk2msftngp13.phx.gbl, Andrew Mallette <Andrewm270@aol.com> typed: > i've just added exchange 2003 to a small bu...

550 5.1.1 user unknown
We have a client that gets the error below intermittently. I have worked with this client's IT staff over the phone to help resolve the issue. The thing is is that they can send e-mails to us half the time and the other times they get the message below. This happens to all users within our organization with this client. They client's IT staff seems pretty comfortable that it is not their end but this is the only client we have problems with. Does anyone have any suggestions as to what could be causing this? If so, any advice would be appreciated. thanks! Sent <<&...

Take a look at the important update from the Microsoft Corporation
--emiqbvbiclcqkp Content-Type: multipart/related; boundary="yifoawvdossxi"; type="multipart/alternative" --yifoawvdossxi Content-Type: multipart/alternative; boundary="jcntgvofppoyqzlc" --jcntgvofppoyqzlc Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Partner this is the latest version of security update, the "October 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install ...

Executing a macro command
How do I execute a macro command by just typing something in a cell? For example, when a user type letter Y in cell A1.. macro 1 will execute, then when he types letter B also in cell A1, the second macro will execute and so on. Thank you. There is an event macro that runs when you change a cell value, the worksheet_change macro, make that macro decide which macro to call and do it. See http://www.cpearson.com/Excel/Events.aspx HTH. Best wishes Harald "Salza" <zainuddinz@gmail.com> wrote in message news:a496ff7c-18db-4130-91ea-193508da79a5@n16g2000yqm.goog...

adding a new user to email
okay so i have tried so many time to add my husband onto outlook email but for some reason it will not allow me to do so and it really is driving me mad! this is the steps i am taking... Does he have a separate account? Have you added this account from Control Panel->Mail Icon? What version of Outlook are you using? BTW - the steps you listed are going to elicit the same problem every time. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the SWEN virus, all mail sent to my personal account will be deleted without reading. A...

Attn: M02,3,4 users who use Passport/WinLiveID
You will get broken at the end of July, 2008. (That's about 45 days from now.) See http://support.microsoft.com/kb/894020. You should remove the Passport/WinLiveID from your file before that time. (File|Password Manager). There have been many indications this day would come. Now you all have a date certain. Does this also means backup files taken from M02,3,4 will be inaccessible, even if they are opened with a current version of Money? Although if you have to go back four, five or six years you probably have bigger issues. But I have at times opened older backup files, even five...