you will always have to close the userform at some time so add a exit command button
to the userform
Private Sub CommandButton1_Click()
Unload UserForm1
worksheets("Sheet1").activate
End Sub
and
Private Sub UserForm_QueryClose(Cancel%, CloseMode%)
If CloseMode = vbFormControlMenu Then
MsgBox " click the Exit button to close the UserForm"
Cancel = True
End If
End Sub
and also add the code to open workbook event in thisworkbook module
Private Sub Workbook_Open()
worksheets("Sheet2").activate
userform1.show
End Sub
Bookmarks