Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to create a list from a table

I have a 2 x 2 table:
C D
A 1 2
B 3 4

I would like to tranform it into a list as follows:
Row Column Value
A C 1
A D 2
B C 3
B D 4
How do I do this in Excel. Of course my tables are much bigger than this and
they are not Pivot Tables.
thanks
Joaquim
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default How to create a list from a table

Select your entire table and run this code...

Sub test()
Dim rng As Range
Dim rngToSearch As Range
Dim rngSelection As Range
Dim wksNew As Worksheet
Dim rngPaste As Range

Set rngSelection = Selection
With rngSelection
Set rngToSearch = Range(.Cells(2, 2), .Cells(.Cells.Count))
End With

Set wksNew = Worksheets.Add
Set rngPaste = wksNew.Range("A1")
For Each rng In rngToSearch
rngPaste.Value = Intersect(rng.EntireRow, _
rngSelection.Columns(1).EntireColumn)
rngPaste.Offset(0, 1).Value = Intersect(rng.EntireColumn, _
rngSelection.Rows(1).EntireRow)
rngPaste.Offset(0, 2).Value = rng.Value
Set rngPaste = rngPaste.Offset(1, 0)
Next rng
End Sub
--
HTH...

Jim Thomlinson


"Joaquim" wrote:

I have a 2 x 2 table:
C D
A 1 2
B 3 4

I would like to tranform it into a list as follows:
Row Column Value
A C 1
A D 2
B C 3
B D 4
How do I do this in Excel. Of course my tables are much bigger than this and
they are not Pivot Tables.
thanks
Joaquim

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create List from a Table Sunnyskies Excel Discussion (Misc queries) 3 June 19th 09 02:05 PM
Create list based on data table Jack Excel Discussion (Misc queries) 1 January 22nd 09 08:26 AM
How-to create a list from a summary table? (Office 2007) Mikael Lindqvist Excel Worksheet Functions 2 January 18th 08 01:00 PM
How to create list and count from a table? PL New Users to Excel 1 June 21st 07 03:09 PM
How to create a data list from a pivot table Nilhan Excel Discussion (Misc queries) 1 November 8th 06 01:40 AM


All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"