Thomas Kuriakose
Active Member
Respected Sirs,
We have multiple sheets in a workbook.
We need to have two worksheets visible at any given time, they are KPI Index and Instructions.
The below code is working for the active sheet KPI Index. How can the worksheet Instructions be added in this to have the two worksheets visible.
Thank you very much.
with regards,
thomas
We have multiple sheets in a workbook.
We need to have two worksheets visible at any given time, they are KPI Index and Instructions.
The below code is working for the active sheet KPI Index. How can the worksheet Instructions be added in this to have the two worksheets visible.
Code:
Dim ws As Worksheet
Dim strName As String
Application.ScreenUpdating = False
strName = ActiveSheet.Name
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> strName Then
ws.Visible = (WorksheetFunction.CountIf(rngGiven, ws.Name) > 0)
End If
Next ws
Application.ScreenUpdating = True
End Sub
Thank you very much.
with regards,
thomas
Last edited by a moderator: