Deleting the texts in columns which have a value in another column on the same line

Copper Contributor

I want to delete the email addresses in a column of those persons who have donated money (which is contained in a separate column on the same line).

1 Reply

@siefedub 

Let's say the email addresses are in E2 and down, and the amount of money donated in M2 and down.

Run the following macro:

Sub ClearEmail()
    Dim r As Long
    Dim m As Long
    Application.ScreenUpdating = False
    m = Range("M" & Rows.Count).End(xlUp).Row
    For r = 2 To m
        If Range("M" & r).Value <> "" Then
            Range("E" & r).ClearContents
        End If
    Next r
    Application.ScreenUpdating = True
End Sub