Forum Discussion
Macros in Excel dropdown box
If I understand correctly, when the user clicks on the 'go to example page' buttons on the candidate results worksheet, you want the macro attached to the 'back to resulting' button on the 'example answers' worksheet to return to the correct candidate results worksheet?
You could set up a Worksheet_Deactivate event in the Thisworkbook vba module to test worksheets as they are deactivated for names beginning with "candidate results" and store that worksheet into a public variable (note this macro is not attached to a button - it is triggered whenever you switch worksheets as the old worksheet is deactivated and the new one is activated). Then the return to results macro can test that variable and activate the saved worksheet.
I attached a workbook with what I think you're looking for.
- JMB17Dec 06, 2020Bronze ContributorYou're quite welcome. Good luck with your project.