98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Opening a new worksheet
Opening a new worksheet
Resolved · 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
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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Make a quick copy of a worksheetHold 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. |