@Adam Davis's answer is perfect, but just in case you're as clueless as I am about Excel VBA, here's what I did to get the code working in Excel 2007:
- Open the workbook with the Matrix that needs to be flattened to a table and navigate to that worksheet
- Press Alt-F11 to open the VBA code editor.
- On the left pane, in the Project box, you'll see a tree structure representing the excel objects and any code (called modules) that already exist. Right click anywhere in the box and select "Insert->Module" to create a blank module file.
- Copy and paste @Adman Davis's code from above as is into the blank page the opens and save it.
- Close the VBA editor window and return to the spreadsheet.
- Click on any cell in the matrix to indicate the matrix you'll be working with.
- Now you need to run the macro. Where this option is will vary based on your version of Excel. As I'm using 2007, I can tell you that it keeps its macros in the "View" ribbon as the farthest right control. Click it and you'll see a laundry list of macros, just double click on the one called "ReversePivotTable" to run it.
- It will then show a popup asking you to tell it where to create the flattened table. Just point it to any empty space an your spreadsheet and click "ok"
You're done! The first column will be the rows, the second column will be the columns, the third column will be the data.