Hi
I want to hide sheets based on sheets names in column B , if the cell C2 is zero then should hide sheets except MAIN sheet if if it's not then should show the all of sheets.
I have this code , but doesn't do anything !
I hope finding assistance
I want to hide sheets based on sheets names in column B , if the cell C2 is zero then should hide sheets except MAIN sheet if if it's not then should show the all of sheets.
I have this code , but doesn't do anything !
VBA Code:
Sub VV()
Dim ws As Worksheet
Dim C As Range
Set ws = Sheets("MAIN")
Application.ScreenUpdating = False
For Each C In ws.Range("B2", Range("B" & Rows.Count).End(xlUp))
If ws.Range("C2").Value = 0 Then
Sheets(C.Value).Visible = False
Else
Sheets(C.Value).Visible = True
End If
Next C
Application.ScreenUpdating = True
End Sub