Forum Discussion
Jon_Morgan1958
Sep 24, 2023Copper Contributor
Select Worksheets by Tab Colour
Hi. I need some help please? My file is organised by WSheet Tab Colour. I need to be able to select all by Tab Colour or some other criteria. Alternately by some other method such as creating a l...
- Sep 24, 2023
Perhaps something like this?
Sub Test() LoopTabColor Color:=vbYellow End Sub Sub LoopTabColor(Color As Long) Dim wsh As Worksheet For Each wsh In Worksheets If wsh.Tab.Color = Color Then ' Do something with this sheet Debug.Print wsh.Name End If Next wsh End Sub
HansVogelaar
Sep 24, 2023MVP
Perhaps something like this?
Sub Test()
LoopTabColor Color:=vbYellow
End Sub
Sub LoopTabColor(Color As Long)
Dim wsh As Worksheet
For Each wsh In Worksheets
If wsh.Tab.Color = Color Then
' Do something with this sheet
Debug.Print wsh.Name
End If
Next wsh
End SubJon_Morgan1958
Sep 30, 2023Copper Contributor
Brilliant thanks Hans.