Here is a VBA function which can handle the special case of 3 number sets:
Function CartesianProduct(nums1 As Range, nums2 As Range, nums3 As Range) As Variant
Dim n As Long 'number of products
Dim i As Long, j As Long, k As Long, r As Long
Dim products As Variant
n = nums1.Cells.Count * nums2.Cells.Count * nums3.Cells.Count
ReDim products(1 To n, 1 To 3)
For i = 1 To nums1.Cells.Count
For j = 1 To nums2.Cells.Count
For k = 1 To nums3.Cells.Count
r = r + 1 'current row
products(r, 1) = nums1.Cells(i)
products(r, 2) = nums2.Cells(j)
products(r, 3) = nums3.Cells(k)
Next k
Next j
Next i
CartesianProduct = products
End Function
This can be called from another VBA function or sub, or used directly as an array formula in the sheet:

In the above screenshot I selected the range A3:C8 (needing to determine its size ahead of time) entered the formula
=CartesianProduct(A1,B1:D1,E1:F1)
and then accept it as an array formula by entering it with Ctrl+Shift+Enter
.
Once you get beyond three sets, things get a bit tricky since you can't hardwire in the necessary levels for a looping approach and would instead probably use a recursive approach, something along the lines of this answer: https://stackoverflow.com/a/31622856/4996248