Paste this in a standard module:
Public Sub SebN()
Dim CVal As Double
Dim BVal As Double
With ActiveSheet
For i = 2 To .Cells(Rows.Count, 3).End(xlUp).Row
CVal = .Cells(i, 3).Value
BVal = .Cells(i, 2).Value
If BVal = 0 Then GoTo skip
For j = 2 To .Cells(Rows.Count, 2).End(xlUp).Row
If .Cells(j, 3).Value = CVal Then
.Cells(j, 2).Value = BVal
End If
Next j
skip:
Next i
End With
End Sub
This assumes the data to process is the only thing in these columns, and starts in row 2.
Oh shoot, Steve's is much easier. Good lesson here, look for simplest solution first instead of relying too much on VBA.
Bookmarks