opening new worksheet
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

replyReply Mon 6 Oct 2008, 11:11Delegate Angela said...

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

For upcoming training course dates see: Pricing & availability

replyReply Tue 7 Oct 2008, 13:15Trainer Laura said...

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

replyReply Tue 7 Oct 2008, 14:20Delegate Angela said...

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

replyReply Fri 24 Oct 2008, 11:26 Edited on Fri 24 Oct 2008, 11:27Trainer Laura said...

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

 

Please browse our web site to find out more about
excel 2003 training and other Microsoft training courses.

Excel tip:

Quickly copy a formula across sheets

Suppose you have a formula in cell Sheet1!B2, say =A1*5%, that you wish to copy to cell B2 on Sheet2, Sheet3 and Sheet4. Instead of using copy and paste, try this: (1) Select Sheet1!B2. (2) Group Sheet1 with the worksheets Sheet2, Sheet3 and Sheet4 by holding down Ctrl and clicking on the tabs of the sheets to group them. (3) Press the F2 key, then immediately press Enter to copy the formula in Sheet1!B2 across the grouped sheets.

Remember to ungroup the sheets afterwards! Right-click on any tab and choose Ungroup Sheets to do that.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard