Hi,
I am trying to make macro which will hide specific sheets when UserForm is closed. Unfortunately UserForm_QueryClose does not allow me to hide them --> They always popup.
I've been using next macroes:
Module1:
frmForm
Reason why I hide sheets is that form put values inside, so they have to be visible while form is open. Otherwise, they have to be hidden from user.
What could be a problem?
I am trying to make macro which will hide specific sheets when UserForm is closed. Unfortunately UserForm_QueryClose does not allow me to hide them --> They always popup.
I've been using next macroes:
Module1:
Code:
Sub Show_Form()
frmForm.Show
Sheet2.Visible = xlSheetVisible
Sheet5.Visible = xlSheetVisible
Sheet9.Visible = xlSheetVisible
End Sub
frmForm
Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Sheet2.Visible = xlSheetVeryHidden
Sheet5.Visible = xlSheetVeryHidden
Sheet9.Visible = xlSheetVeryHidden
End Sub
Reason why I hide sheets is that form put values inside, so they have to be visible while form is open. Otherwise, they have to be hidden from user.
What could be a problem?