I’m attempting to add a “Y” to ws1, Column Q
This only adds “Y” from the last item in ws6.
I do not understand what I’m doing wrong.
<strike></strike>
This only adds “Y” from the last item in ws6.
I do not understand what I’m doing wrong.
Code:
Sub MacroUpdateY2()
Dim Cl As Range
Dim sKey As String
Dim ws1 As Worksheet
Dim ws6 As Worksheet
Set ws6 = Sheets("6")
Set ws1 = Sheets("1")
With CreateObject("scripting.dictionary")
For Each Cl In ws6.Range("A2", ws6.Range("A" & Rows.Count).End(xlUp))
sKey = Trim(Cl.Value)
Next Cl
For Each Cl In ws1.Range("C2", ws1.Range("C" & Rows.Count).End(xlUp))
If sKey = (Cl.Value) Then
Cl.Offset(, 14).Value = "Y"
End If
Next Cl
End With
End Sub