opening new worksheet

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Opening a new worksheet

Opening a new worksheet

resolvedResolved · High Priority · Version 2003

Angela has attended:
Excel VBA Intro Intermediate course

Opening a new worksheet

Hi

I want to write a macro to open a new worksheet when a particular checkbox is selected. I don't want to assign the macro to the check box or a button, I also want a message box to pop up to remind the user to complete the new worksheet.

For example:

My checkbox is linked to another sheet Calculations!H15 which gives the output or True or False. I need to keep this as is as other formulas rely on this output.

what do I need to do to activate this macro to open this new worksheet?

Many thanks

RE: Opening a new worksheet

Hi Angela

Thank you for the question.

My first question is why don't you want to assign the macro to the check box?

When would you like the macro to run as it needs an event to trigger it?



Laura GB

RE: Opening a new worksheet

Hi Laura
I've tried doing that... how do I only get the macro to run when the checkbox is ticked ? It seems that the macro runs each time the checkbox is selected or deslected.

Tks

Edited on Fri 24 Oct 2008, 11:27

RE: Opening a new worksheet

Hi Angela

You need to put an If statement in to look at Calculations!H15.

For Example


If Sheets("Calculations").Range("H15") = True Then
'code to run when the box is ticked
Else
'code to run when the box is not ticked
End If


I hope that helps

Laura GB

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Make a quick copy of a worksheet

Hold down the Ctrl key, then click and drag on a sheet tab to make a copy of that sheet. Though this process usefully copies the formats of the original sheet, note that any Range Names you have on the original sheet will be duplicated too.

To make a copy of a worksheet's contents and formats without duplicating range names: (1) Ensure that you have a blank worksheet to paste to. (2) On the sheet to copy, click on the sheet selection square to the left of Column A's heading to select the whole sheet. (2) Copy the whole sheet. (3) Paste to the blank worksheet.



View all Excel hints and tips


Server loaded in 0.08 secs.