I have a userform with 2 command buttons : hide and show.
This work if I only have 1 workbook open. I can simply hide and show the workbook from the form. However If I have another workbook open let say Book1. and then I click Hide, It will also hide the Book1. I want only to hide the specific workbook.
Here's my code:
Private Sub cmdHide_Click()
'ThisWorkbook("hide_sheet").
Application.Visible = False
End Sub
Private Sub cmdShow_Click()
'ThisWorkbook("hide_sheet").
Application.Visible = True
End Sub
ThisWorkbook
. Or, doIf ThisWorkbook.Name = "firstWorkBook" Then Thisworkbook.hide
or something. – BruceWayne