From: Joe M. on
I have this macro to hide all WS that have red tabs. But it dosn't work. It
only hides one tab when there are many that are red. What is wrong?

Sub Hide_shts()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Tab.Color = 255 Then
ws.Visible = False
End If
Next
End Sub

Thanks,

Joe M.

From: Don Guillett on

See your OTHER posts

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett(a)gmail.com
"Joe M." <JoeM(a)discussions.microsoft.com> wrote in message
news:08D7C94F-D90E-4651-8FF4-3EA8BC4855E1(a)microsoft.com...
>I have this macro to hide all WS that have red tabs. But it dosn't work. It
> only hides one tab when there are many that are red. What is wrong?
>
> Sub Hide_shts()
> Dim ws As Worksheet
> For Each ws In ThisWorkbook.Worksheets
> If ws.Tab.Color = 255 Then
> ws.Visible = False
> End If
> Next
> End Sub
>
> Thanks,
>
> Joe M.
>

From: מיכאל (מיקי) אבידן on
To my opinion it should work.
Try, maybe:
----------------------------------------
If ws.Tab.ColorIndex = 3 Then...
----------------------------------------
If this does not help - record a macro while red coloring another tab in
order to see if your red is really "RED" !?
Micky


"Joe M." wrote:

> I have this macro to hide all WS that have red tabs. But it dosn't work. It
> only hides one tab when there are many that are red. What is wrong?
>
> Sub Hide_shts()
> Dim ws As Worksheet
> For Each ws In ThisWorkbook.Worksheets
> If ws.Tab.Color = 255 Then
> ws.Visible = False
> End If
> Next
> End Sub
>
> Thanks,
>
> Joe M.
>