Hi everyone,

Yudlugar very kindly provided me with the excellent code below which helps the user to identify whether an email address is spam or genuine based on whether it contains @GMAIL.

However it only works when the case is exact, i.e. it doesn't pick up @gmail or @Gmail. How can I add MatchCase := False to the below code?

(I have already marked the old thread as solved so I have started a new one. I hope this is correct protocol).

Dim count
For count = 2 To Range("B" & Rows.count).End(xlUp).row
    If InStr(1, Range("B" & count), "@GMAIL") > 0 Then
        If MsgBox("Is this email spam? " & vbNewLine & vbNewLine & Range("B" & count), vbYesNo) = vbYes Then
            Range("c" & count) = "Spam"
        Else
            Range("c" & count) = "Genuine"
        End If
    Else
        Range("c" & count) = "Genuine"
    End If
Next