I know this has been asked many times but I keep reading and cant get it right. I have included all the necessary End If
and the Do
is there for my Loop
.
My Code
Sub update_names()
Dim EMAIL, NewName As String
Dim i, total As Integer
Dim Search As Range
total = 0
i = 2024
Do While i < 2048
Sheets("Edit Multiple Subscribers").Select
EMAIL = Cells(i, 2).Value
NewName = Cells(i, 1).Value
Sheets("MASTER").Select
With Worksheets("MASTER").Cells
Set Search = .Find(EMAIL, LookIn:=xlValues, After:=ActiveCell)
If Search Is Nothing Then
Sheets("Edit Multiple Subscribers").Select
Cells(i, 2).Interior.Color = RGB(250, 0, 250)
GoTo Add1
Else:
Search.Select
ActiveCell.Offset(0, -1).Select
If ActiveCell.Value = NewName Then
GoTo Add1
Else:
NewName = ActiveCell.Value
End If
End If
Sheets("Edit Multiple Subscribers").Select
ActiveSheet.Cells(i, 2).Select
ActiveCell.Offset(0, -1).Select
ActiveCell.Value = NewName
total = total + 1
Add1: i = i + 1
Loop
MsgBox "Number Of edits: " & total
End Sub