xDRg1, xDRg2, xDRg3 Ranges contain empty Cells. Can I do a combination other than this?
VBA Code:
Sub ListAllCombinations()
'Updateby Extendoffice
Dim xDRg1, xDRg2, xDRg3 As Range
Dim xRg As Range
Dim xStr As String
Dim xFN1, xFN2, xFN3 As Integer
Dim xSV1, xSV2, xSV3 As String
Set xDRg1 = Range("a2", ActiveSheet.Range("a2").End(xlDown)) 'First column data
Set xDRg2 = Range("b2", ActiveSheet.Range("b2").End(xlDown)) 'Second column data
Set xDRg3 = Range("c2", ActiveSheet.Range("c2").End(xlDown)) 'Third column data
xStr = "_" 'Separator
Set xRg = Range("E2") 'Output cell
For xFN1 = 1 To xDRg1.Count
xSV1 = xDRg1.Item(xFN1).Text
For xFN2 = 1 To xDRg2.Count
xSV2 = xDRg2.Item(xFN2).Text
For xFN3 = 1 To xDRg3.Count
xSV3 = xDRg3.Item(xFN3).Text
xRg.Value = xSV1 & xStr & xSV2 & xStr & xSV3
Set xRg = xRg.Offset(1, 0)
Next
Next
Next
End Sub