Hi everyone,
Just wondering if anyone can help me out here.
When the value of column A is changed, I want to refresh the combination of columns b, c, and d.
Also, if the cell is empty, I want it to be ignored.
I've gotten help from the community, but it's not working.
What I want the end result to be E column
Just wondering if anyone can help me out here.
When the value of column A is changed, I want to refresh the combination of columns b, c, and d.
Also, if the cell is empty, I want it to be ignored.
I've gotten help from the community, but it's not working.
VBA Code:
Sub ListAllCombinations()
Dim i&, j&, k&, t&, lrA&, lrB&, lrC&, rng, arr(1 To 100000, 1 To 1)
lrA = Cells(Rows.Count, "B").End(xlUp).Row
lrB = Cells(Rows.Count, "C").End(xlUp).Row
lrC = Cells(Rows.Count, "D").End(xlUp).Row
For i = 2 To lrA
For j = 2 To lrB
For k = 2 To lrC
If IsEmpty(Cells(i, "B")) Or IsEmpty(Cells(j, "C")) Or IsEmpty(Cells(k, "D")) Then
Else
t = t + 1
arr(t, 1) = Cells(i, "B") & "_" & Cells(j, "C") & "_" & Cells(k, "D")
End If
Next
Next
Next
Range("F2").Resize(t, 1).Value = arr
End Sub
What I want the end result to be E column
LOK RPC _ OMS cSKU compare.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Code | Option level1 | Option level2 | Option level3 | EX) Result | ||
2 | 888881 | red | 888881_red_100 | ||||
3 | 888881 | blue | 888881_red_200 | ||||
4 | 888881 | Orange | 888881_blue_100 | ||||
5 | 888881 | 100 | 888881_blue_200 | ||||
6 | 888881 | 200 | 888881_Orange_100 | ||||
7 | 77777 | blue | 888881_Orange_200 | ||||
8 | 77777 | red | 888881_Orange_200 | ||||
9 | 77777 | 200 | 77777_blue_200_K | ||||
10 | 77777 | K | 77777_red_200_K | ||||
11 | |||||||
12 | |||||||
Sheet1 |