Hi all,
Need some help to edit the code below....
Sub Show_4Pluss()
Range("A1").Select
Application.ScreenUpdating = False
N1 = Range("H1").Value
N2 = Range("P1").Value
ReDim Data_1(N1, 6), Data_2(N2, 6)
nRow = 1
Do While ActiveCell.Offset(nRow, 17).Value <> ""
ActiveCell.Offset(nRow, 17).Value = ""
ActiveCell.Offset(nRow, 18).Value = ""
ActiveCell.Offset(nRow, 19).Value = ""
nRow = nRow + 1
Loop
For I = 1 To N1
For J = 1 To 6
Data_1(I, J) = ActiveCell.Offset(I, J).Value
Next J
Next I
For I = 1 To N2
For J = 1 To 6
Data_2(I, J) = ActiveCell.Offset(I, J + 8).Value
Next J
Next I
nRow = 0
For I = 1 To N1
For J = 1 To N2
Nx4 = 0
For K = 1 To 6
For L = 1 To 6
If Data_1(I, K) = Data_2(J, L) Then Nx4 = Nx4 + 1
Next L
Next K
If Nx4 >= 3 Then
nRow = nRow + 1
ActiveCell.Offset(nRow, 17).Value = I
ActiveCell.Offset(nRow, 18).Value = J
ActiveCell.Offset(nRow, 19).Value = Nx4
End If
Next J
Next I
Application.ScreenUpdating = True
End Sub
The above matches a set of combinations with 6 numbers to another combinations with 6 numbers. But now I want it to match with a set of combinations with 7 numbers. This set of 7 numbered combinations will be place in the cells b2:h2 onwards.
Hope somebody can help me with changing the code. Thanks.
Flex
Bookmarks