I have a Summary worksheet that I use to compile data from every worksheet in my workbook. I want to alter my current code to only compile data from worksheets whose tabs are colored Red. The code I'm using is below. The argument I cannot get to work properly seems pretty straightforward, and is highlighted in bold below. I have very little VBA experience, so if somebody could please help me out I'd really appreciate it.
Sub Copy_Sheets()
Dim n As Integer
Dim End_Row As Long
Dim ws As Worksheet
Dim wb As Workbook
For Each ws In Worksheets
If ws.Name <> "Sheet1" And ws.Name <> "Sheet2" And _ ws.Tab.Color = 3 Then
With ws
End_Row = .Range("A65536").End(xlUp).Row
.Range("A2:Ad" & End_Row).Copy Destination:= _
Sheets("Summary").Range("A65536").End(xlUp).Offset(1, 0)
End With
End If
Next ws
End Sub
Sub Copy_Sheets()
Dim n As Integer
Dim End_Row As Long
Dim ws As Worksheet
Dim wb As Workbook
For Each ws In Worksheets
If ws.Name <> "Sheet1" And ws.Name <> "Sheet2" And _ ws.Tab.Color = 3 Then
With ws
End_Row = .Range("A65536").End(xlUp).Row
.Range("A2:Ad" & End_Row).Copy Destination:= _
Sheets("Summary").Range("A65536").End(xlUp).Offset(1, 0)
End With
End If
Next ws
End Sub