Sub M_snb()
Dim ws As Worksheet
On Error Resume Next
For Each it In Sheets
If ws.Name <> "control" Or ws.Name <> "linkslist" Then
x3 = it.Range("P2:P35").SpecialCells(4)
If Err.Number = 0 Then Exit For
Err.Clear
Else
End If
Next
MsgBox it.Name
End Sub
Thank you both for your replies. However, the codes does not seem to work for me.
Mana: Your code just generates a "NOT OK" for the sheet("control") and it stops afterwards.
Snb: Your code works but it does not detect the blank cell within the range. I guess your code detects the whole range and if other cells are filled, it will just run through without the message box popping up. How do i use code tags?
Sub M_snb()
Dim ws As Worksheet
On Error Resume Next
For Each it In Sheets
If ws.Name <> "control" Or ws.Name <> "linkslist" Then
x3 = it.Range("P2:P35").SpecialCells(4)
If Err.Number = 0 Then Exit For
Err.Clear
Else
End If
Next
MsgBox it.Name
End Sub
Thank you for both your replies