View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Greg Wilson[_3_] Greg Wilson[_3_] is offline
external usenet poster
 
Posts: 35
Default How to program a three dimentional table in excel

I think one of the two macros is what you are looking for.

The first lists all possible combinations of length, width
and height. The second restricts the list to only
dimentions that refer to unique shapes since length, width
and height are arbitrary designations.

Option Base 1 'Place at top of module

Sub Combinations1()
Dim i As Integer, ii As Integer, iii As Integer
Dim Ar As Variant, Txt As String
Ar = Array(10, 20, 30)

For i = 1 To 3
For ii = 1 To 3
For iii = 1 To 3
Txt = Ar(i) & " x " & Ar(ii) & " x " & Ar(iii)
Range("A65536").End(xlUp).Offset(1) = Txt
Txt = ""
Next iii
Next ii
Next i

End Sub

Sub Combinations2()
Dim i As Integer, ii As Integer
Dim Ar As Variant, Txt As String
Ar = Array(10, 20, 30)

For i = 1 To 3
For ii = 1 To 3
Txt = Ar(i) & " x " & Ar(i) & " x " & Ar(ii)
Range("B65536").End(xlUp).Offset(1) = Txt
Txt = ""
Next ii
Next i
End Sub

Done with minimal testing so check for accuracy.

Regards,
Greg



-----Original Message-----
Hi all,

I have three numbers 10, 20 & 30 and I want all possible

combinations of the
three numbers which I can get by generating a three

dimentional table.

Has anyone got any ideas of how I could go about putting

something like that
in excel.

Thanks in advance.

Pantelis


.