Good morning,
i would realy appreciate your assistance to to change or modify vb code please.
Sub Combo()
Dim lCol As Long, lJJ As Long, lKK As Long, lRw As Long
Dim vAry As Variant
lRw = Cells(2, 1).End(xlDown).Row - 1
lCol = Cells(1, 2).End(xlToRight).Column - 1
ReDim vAry(1 To lCol, 1 To 1)
With Range("B2").Resize(lRw, lCol)
For lKK = 1 To lCol
For lJJ = 1 To lRw
If .Cells(lJJ, lKK) = "X" Then vAry(lKK, 1) = vAry(lKK, 1) & Cells(lJJ + 1, 1)
Next lJJ
Next lKK
End With
Cells(lRw + 3, 2).Resize(lCol, 1).Value = vAry
End Sub
Code result Expected Result
12379 1,2,3,7,9
12348 1,2,3,4,8
12457 1,2,4,5,7
12569 1,2,5,6,9
12678 1,2,6,7,8
13469 1,3,4,6,9
13567 1,3,5,6,7
13589 1,3,5,8,9
14568 1,4,5,6,8
14789 1,4,7,8,9
23456 2,3,4,5,6
23578 2,3,5,7,8
23689 2,3,6,8,9
24589 2,4,5,8,9
24679 2,4,6,7,9
34579 3,4,5,7,9
34678 3,4,6,7,8
56789 5,6,7,8,9
thank you
sem
Bookmarks