Sounds like easy Find method...
Sub UpdatecampaignId()
Dim DR As Long
Dim Cell As Range, rng As Range
Dim Wks As Worksheet, ff As String, r As Range
Set rng = Rows(1).Find("campaignId")
If Not rng Is Nothing Then
DR = rng.Column
Set Wks = Worksheets("campaignId")
Set rng = Wks.Range("A1").CurrentRegion
Set rng = Intersect(rng, rng.Offset(1, 0))
For Each Cell In rng.Columns(1).Cells
Key = Trim(Cell)
Set r = Sheets("copied sheet").Columns(DR).Find(Cell, , , 1)
If Not r Is Nothing Then
ff = r.Address
Do
r.Value = Cell.Offset(, 1)
r.Interior.ColorIndex = 6
Set r = Sheets("copied sheet").Columns(DR).Find(Cell, r)
If r Is Nothing Then Exit Do
Loop While ff <> r.Address
End If
Next Cell
End If
End Sub
Bookmarks