Question : Convert matrix values to columns

Re MS Excel2003
Help I have a large grid of data which I would like to convert
to columns (to put into a database).

In simple terms I have
(note alpha's and numerics)
    X   Y   Z etc      
A   1   2   3
B   4   5   6
C   7   8   9
etc

Which I need to convert to (note each alpha numeric is in a separate cell)
X A 1
X A 2
X A 3
Y B 4
Y B 5
Y B 6
Z C 7
Z C 8
Z C 9
etc

In reality I have something like 600 rows and 30 columns making up the data grid.
I would b grateful for any help on this please. Thanks

Answer : Convert matrix values to columns

This appears to be working.  It uses array transfers to speed things along.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
Sub FlatList()
    
    Dim arr As Variant
    Dim r As Long, c As Long
    Dim Results() As Variant
    Dim DestR As Long
    
    arr = Range("a1", Range("a1").SpecialCells(xlCellTypeLastCell)).Value
    ReDim Results(1 To (UBound(arr, 1) - 1) * (UBound(arr, 2) - 1), 1 To 3) As Variant
    
    For r = 2 To UBound(arr, 1)
        For c = 2 To UBound(arr, 2)
            DestR = DestR + 1
            Results(DestR, 1) = arr(1, c)
            Results(DestR, 2) = arr(r, 1)
            Results(DestR, 3) = arr(r, c)
        Next
    Next
    
    Worksheets.Add
    Cells(1, 1).Resize(UBound(Results, 1), UBound(Results, 2)) = Results
    
    Cells(1, 1).Sort Key1:=Cells(1, 1), Key2:=Cells(1, 2), Order1:=xlAscending, Order2:=xlAscending, _
        Header:=xlNo
        
End Sub
Random Solutions  
 
programming4us programming4us