chingching831
New Member
- Joined
- Jun 2, 2022
- Messages
- 30
- Office Version
- 2019
- Platform
- Windows
Hi there,
I have a code to hide worksheets based on specific RGB colours. But I am not sure why it isn't working ...
I have a code to hide worksheets based on specific RGB colours. But I am not sure why it isn't working ...
VBA Code:
Sub HideColouredTabs()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Tab.Color = RGB(191, 191, 191) Then
ws.Visible = xlSheetHidden
End If
Next ws
End Sub