Hi,
I have a Transfer Data loop that runs very slow.
Is there any way to make this more efficeint?
Code
Sub Transfer_Comments()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim WS1 As Worksheet
Dim WS2 As Worksheet
Dim Last As Long
Dim i As Long
Dim j As Long
Set WS1 = Worksheets("Sheet 1")
Set WS2 = Worksheets("Sheet 2")
'Transfer Comments
For i = 1 To WS1.Cells(WS1.Rows.Count, 2).End(xlUp).Row
For j = 1 To WS2.Cells(WS2.Rows.Count, 2).End(xlUp).Row
If WS1.Cells(i, 11).Value2 = WS2.Cells(j, 11).Value2 And WS1.Cells(i, 14).Value2 = WS2.Cells(j, 14).Value2 Then
WS1.Cells(i, 10).Value = WS2.Cells(j, 10).Value
WS1.Cells(i, 22).Value = WS2.Cells(j, 22).Value
End If
Next j
Next i
WS2.Delete
Set WS1 = Nothing
Set WS2 = Nothing
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Display More