Darren Smith
Well-known Member
- Joined
- Nov 23, 2020
- Messages
- 631
- Office Version
- 2019
- Platform
- Windows
Hi all
Trying to match worksheets see below. Can`t make it work??
Trying to match worksheets see below. Can`t make it work??
VBA Code:
If ListBox4 = "Fills Job Card Master Sheet into Time Analysis Sheet" Then
Dim Ary As Variant, Nary As Variant
Dim wsDest As Worksheet
Set wsDest = Worksheets("Job Card with Time Analysis")
Dim rng As Range
Set rng = wsDest.Range("A10:N")
Dim Dic As Object
Dim l As Long
Set Dic = CreateObject("scripting.dictionary")
With Sheets("Job Card Master")
Ary = .Range("A10", .Range("A" & Rows.Count).End(xlUp)).Value2
Nary = .Range("A10:N" & .Range("A" & Rows.Count).End(xlUp).Row).Value2
End With
With Sheets("Job Card with Time Analysis")
For Each rng In .Range("A10", .Range("A" & Rows.Count).End(xlUp))
Dic(rng.Value) = Empty
Next rng
End With
For l = 1 To UBound(Ary)
If Dic.Exists(Ary(r, 1)) Then Nary(r, 1) = "Yes"
Next l
Sheets("Job Card Master").Range("A10").Resize(UBound(Nary)).Value = Nary
End If
End Sub