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.
Private Sub CMD_NEXT_Click()
Dim ws
Set ws = Worksheets(Worksheets.Count)
If A1.Value = True Then
ws.Range("H6").Value = 0
End If
'About 40 other similar IF statements run after this, I've cut them out to minimise pointless code here
Unload Me
Sheets("Working Perspex").Select
Range("A1").Select
MarkingCriteria2.Show
End Sub
Display More
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