Calling a userform from within another userform.

  • I am using a series of multiple userforms to collect rather a lot of data. I start with a userform called "MarkingCriteria1" that launches from a sheet called "Working Glass". This sheet is visible under the userform in the background. When the userform is filled out, the user clicks a command button on the form called "NEXT" to launch the next userform in the series (called "MarkingCriteria2"). This all works fine.


    However, I would like the worksheet in the background to change to a sheet called "Working Perspex" when "MarkingCriteria2" is launched. I have coded for "MarkingCriteria1" to unload, "Working Perspex" to be selected, and then "MarkingCriteria2" to launch. However, the worksheet does not change.



    As a workaround I tried calling a macro where the "MarkingCriteria2.Show" line of code was, and had the macro launch MarkingCriteria2. This didn't solve the problem either. If I click on the 'cross box' in the top right hand corner to close the userform "MarkingCriteria2" while it is running, the sheet "Working Perspex" is selected then. I want the sheet to change during the changeover between the two userforms. I'd like to think of myself at being fairly competent in VBA, but this has me completely stumped. What am I missing here?!?!



    Thanks in advance!



    Andy

  • Re: Calling a userform from within another userform.


    On testing (granted, some pretty mild testing) your code worked fine for me. Are you sure everything is named correctly? (the worksheet in particular)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!