See next code
Option Explicit
Sub Treat()
Const OrgWsName As String = "Sheet1"
Const DstWsName As String = "Sheet2"
Const OrgCol As String = "F"
Const DstCol As String = "C"
Const WkCol As String = "B"
Const FR As Integer = 2
Dim Rg As Range
Dim DataDic As Object
Set DataDic = CreateObject("Scripting.Dictionary")
With Sheets(OrgWsName)
For Each Rg In Range(.Cells(FR, WkCol), .Cells(Rows.Count, WkCol).End(3))
DataDic.Item(Rg.Value) = .Cells(Rg.Row, OrgCol).Value
Next Rg
End With
With Sheets(DstWsName)
For Each Rg In Range(.Cells(FR, WkCol), .Cells(Rows.Count, WkCol).End(3))
.Cells(Rg.Row, DstCol) = 0
If (DataDic.exists(Rg.Value)) Then _
.Cells(Rg.Row, DstCol) = DataDic.Item(Rg.Value)
Next Rg
End With
MsgBox (" Job Done")
End Sub
Bookmarks