Hi all,
I have a client comments in sheet Client Comments that I would like to paste to sheet All Comments. Client ID's are in Column AV and comments in Column CE in both sheets. The code below takes 13 minutes and doesn't paste any comments so would appreciate any support.
In Phase 1, I'm building the dictionary (here, I need a code to only build dictionary for rows AV2: AV150).
In Phase 2, I'm comparing Client ID's with the master sheet (all comments) that has 5000 Clients and pasting their values.
I have a client comments in sheet Client Comments that I would like to paste to sheet All Comments. Client ID's are in Column AV and comments in Column CE in both sheets. The code below takes 13 minutes and doesn't paste any comments so would appreciate any support.
In Phase 1, I'm building the dictionary (here, I need a code to only build dictionary for rows AV2: AV150).
In Phase 2, I'm comparing Client ID's with the master sheet (all comments) that has 5000 Clients and pasting their values.
Code:
Dim dict As New Scripting.Dictionary
Dim myRow As Range
Dim mySheet As Worksheet
Const RefSheetName As String = "client comments"
Set mySheet = ThisWorkbook.Worksheets(RefSheetName)
For Each myRow In mySheet.Range(mySheet.Range("Av1").End(xlDown), mySheet.Range("Av" & mySheet.Rows.Count).End(xlUp))
dict.Add myRow.Value, myRow.Offset(0, 38).Value
Next myRow
For Each myRow In Workbooks("e127.xlsb").Worksheets("all comments").Range("av1:av5000")
If dict.exists(myRow.Value) Then
myRow.Offset(0, 38).Value = dict(myRow.Value)
End If
Next myRow
Last edited: