View Single Post
 
Old 01-29-2025, 11:20 AM
batman1 batman1 is offline Windows 11 Office 2013
Advanced Beginner
 
Join Date: Jan 2025
Posts: 57
batman1 is on a distinguished road
Default

If the results are to be in 5 columns: Ref#, SN, Title, Date, Name then change it to
Code:
ReDim result(1 To UBound(data, 1), 1 To 5) 
…
If dic.exists(key) Then
            count = count + 1
            result(count, 1) = dic.Item(key)  
            result(count, 2) = data(i, 1)
            result(count, 3) = data(i, 3)
            result(count, 4) = data(i, 4)
            result(count, 5) = data(i, 5)
End If
…
Worksheets("Sheet3").Range("A2").Resize(count, 5).Value = result
Reply With Quote