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

opening new worksheet

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

Opening a new worksheet

ResolvedVersion 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:

Create your own custom list on Excel 2010!

If you know how to use the auto-fill option on Excel then why not create your own customs lists?

The auto fill feature saves you time by allowing you to enter one of the list entries into a cell and then use your mouse to automatically drag the rest of the list into the cells below, above or to either side of the initial cell. When using your mouse to perform this task you will see a thin black cross appear at the bottom right hand side of the cell. Click, hold and drag to make the list appear.

Default lists include weekdays and months. To create your own list in Excel 2010 do the following;

>File
>Options
>Advanced
>Scroll right to the bottom of the page and you will see a buttom "edit custom lists", click this button
>enter your list in the list entries
>click add

Now try it out. Good luck.
>

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.