This is ridiculous code:
You should replace it byIf ws.name Like "Warning_Markers*" Then Dim M As Double M = ws.Rows.Count ' avoid overflow M = M * ws.Columns.Count If Application.CountBlank(ws.Cells) = M Then MsgBox ws.name & " is empty" Exit Sub End If
If ws.usedrange.address <>"$A$1" Then