VBA Multiple match without duplicates

kapib

New Member
Joined
Aug 2, 2022
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I am fairly new to Excel VBA.

I have a set of matching values as shown in the picture attached. I would like to extract all the matching dates from the 7th column and extract all the 'unique dates' and list it in the columns against each matching values. I use excel 2016 . The Inputs are in sheet 2.

I managed to get the dates with array index formula but it gets slow with large data. Any help would be great.
 

Attachments

  • Multiple_match.jpg
    Multiple_match.jpg
    110.6 KB · Views: 18

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
kapib let's get the ball rollin. Now this usually generates more questions than answers, but we have to start some place. Also this program isn't dynamic. It only works with the data you are showing. If you need other requirements let us know.


VBA Code:
Sub Prog1()

Dim a As Integer

h = 3
For i = 3 To 6
    Cells(h, 10) = Cells(i, 7)
    h = h + 1
Next i

a = 7

For i = 3 To 6
    For h = 11 To 13
        If Cells(i, h - 1) <> Cells(a, 7) Then
            Cells(i, h) = Cells(a, 7)
        Else
            h = h - 1
        End If
    a = a + 4
Next h
a = i + 5
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top