I load a UserForm, do some stuff, then want to hide that UserForm and show one of the open worksheets. This worksheet has a command button to run a macro that will again show the UserForm. What happens is that when I hide the UserForm, the ActiveSheet becomes the one which was active when the UserForm was loaded. Subsequent attempts at defining the active sheet are ignored, with no error messages.
UserForm1.Show
' stuff
Workbooks("datafile").Sheets(1).Activate ' ActiveSheet is correctly redefined
UserForm1.Hide ' ActiveSheet changes to the active sheet when UserForm was loaded
Workbooks("datafile").Sheets(1).Activate ' Ignored. no change to ActiveSheet
' Shows whomever loaded the user form: either the VBA debugger or the original worksheet