Hide an Excel worksheet in another workbook

How to hide a single Excel worksheet in another open or closed workbook using VBA

METHOD 1. Hide an Excel worksheet in another open workbook using VBA

VBA

Sub Hide_Worksheet_in_Another_Open_Workbook()
'declare variables
Dim wb As Workbook
Dim ws As Worksheet
Set wb = Workbooks("Exceldome.xlsx")
'activate the workbook
wb.Activate
Set ws = Worksheets("Sheet2")
'hide a worksheet named Sheet2 in the workbook specified above
ws.Visible = False

End Sub

OBJECTS
Workbooks: The Workbooks object represents all of the open Excel workbooks.
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
PREREQUISITES
Workbook Name: Have an open workbook named Exceldome.xlsx.
Worksheet Name: Have a worksheet named Sheet2 in the Exceldome.xlsx workbook.

ADJUSTABLE PARAMETERS
Worksheet to Hide: Select the worksheet that you want to hide by changing the Sheet2 worksheet name in the VBA code to any worksheet in the workbook.
Workbook Selection: Select the workbook where you want to hide a worksheet by changing the Exceldome.xlsx workbook name to any open workbook.

METHOD 2. Hide an Excel worksheet in another closed workbook using VBA

VBA

Sub Hide_Worksheet_in_Another_Closed_Workbook()
'declare variables
Dim wb As Workbook
Dim ws As Worksheet
Set wb = Workbooks.Open("C:\Excel\Exceldome.xlsx")
'open and activate the workbook
wb.Activate
Set ws = Worksheets("Sheet2")
'hide a worksheet named Sheet2 in the workbook specified above
ws.Visible = False

End Sub

OBJECTS
Workbook: The Workbooks object represents all of the open Excel workbooks.
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
PREREQUISITES
Workbook Location: Have a workbook that you are referencing to in the VBA code located on your device in the C:\Excel\ path.
Workbook Name: Have a closed workbook named Exceldome.xlsx in the location specified in the VBA code.
Worksheet Name: Have a worksheet named Sheet2 in the Exceldome.xlsx workbook.

ADJUSTABLE PARAMETERS
Worksheet Location: Select the location of the workbook where you want to hide a worksheet by changing the C:\Excel\ path.
Workbook Selection: Select the workbook where you want to hide a worksheet by changing the Exceldome.xlsx workbook name to any closed workbook that is located in the path provided in the VBA code.
Worksheet to Hide: Select the worksheet that you want to hide by changing the Sheet2 worksheet name in the VBA code to any worksheet in the workbook.

Explanation about how to hide a worksheet in another workbook

EXPLANATION

EXPLANATION
This tutorial explains and provides step by step instructions on how to hide a single worksheet in another workbook using VBA.

VBA Methods: Using VBA you can hide a worksheet in another open or closed workbook by referencing to a specific workbook. If a workbook is closed, the VBA code will first need to open the workbook and then hide the specified worksheet.