>
> try what is value of ws.Name <> "X" AND ws.Name <> "Y" AND ws.Name <>
>
> "Z" if ws.Name = "T" .
>
>
>
> Is that really false?
>
>
>
> please believe me. It is correct.
I have zero expertise to discuss de Morgan's law, these two macros work on my workbook which has Sheet1, Sheet2, Sheet3, three sheets named X, Y, Z (not SheetX, SheetY, SheetZ)and Sheet4. In that order. The macros are in Sheet1 module.
Option Explicit
Sub LoopThroughSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "X" Or ws.Name = "Y" Or ws.Name = "Z" Then
Else
'Do your code stuff here like:
With ws.Cells
With .Font
.ColorIndex = 3
.Bold = False
.Italic = False
.Underline = False
.Name = "Arial"
.Size = 12
End With
End With
End If
Next
End Sub
Sub LoopThroughSheetsXX()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "X" And ws.Name <> "Y" And ws.Name <> "Z" Then
ws.Range("C5") = ws.Name
With ws.Cells
With .Font
.ColorIndex = 0
.Bold = True
.Italic = True
.Underline = True
.Name = "Arial"
.Size = 12
End With
End With
End If
Next
End Sub
Regards,
Howard