Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default How do I convert a table into a list in excel?

I have a range of data 4 col wide and 400 rows deep. I need to convert the
data into a single column to post the data into another application.
Currently the data looks like this:

200 450.00 test newposting
202 3187362.58 test newposting
205 106392.58 test newposting

And I need it to look like this:
200
450.00
test
newposting
202
3187362.58
test
newposting
205
106392.58
test
newposting

How can I accomplish this without creating a copy/paste nightmare.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How do I convert a table into a list in excel?

try to use the following macro:

Sub divideee()
counter = 0
For Each cell In Selection
For i = 1 To 4
cell.Offset(3 * counter + i - 1, 6) = cell.Offset(0, i - 1)
Next i
counter = counter + 1
Next cell
End Sub

HIH
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default How do I convert a table into a list in excel?

This should work. You can improve it by replacing wxCurr.Rows in the For
Each loop to a defined range.

Sub ChangeLayout()

Dim wsCurr As Worksheet
Dim wsNew As Worksheet
Dim rRow As Range
Dim lngCountRow As Long

Set wsCurr = ActiveWorkbook.Worksheets(1)
Set wsNew = ActiveWorkbook.Worksheets(2)

lngCountRow = 1 ' set to whatever row you begin in

For Each rRow In wsCurr.Rows
If rRow.EntireRow.SpecialCells(xlCellTypeConstants).C ount = 1 Then

rRow.EntireRow.SpecialCells(xlCellTypeConstants).C opy
wsNew.Range("A" & lngCountRow).PasteSpecial Transpose:=True
lngCountRow = lngCountRow +
rRow.EntireRow.SpecialCells(xlCellTypeConstants).C ount
End If
Next rRow

End Sub

"scott" wrote:

I have a range of data 4 col wide and 400 rows deep. I need to convert the
data into a single column to post the data into another application.
Currently the data looks like this:

200 450.00 test newposting
202 3187362.58 test newposting
205 106392.58 test newposting

And I need it to look like this:
200
450.00
test
newposting
202
3187362.58
test
newposting
205
106392.58
test
newposting

How can I accomplish this without creating a copy/paste nightmare.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How do I convert a table into a list in excel?

1. select yr cells containing 200, 202...
2. run the macro

the result will be 6 columns to the right from selection
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default How do I convert a table into a list in excel?

The macro works great except that I loose my decimal places on all whole
dollars. How do I keep the formatting in the amount column?

"Jarek Kujawa" wrote:

try to use the following macro:

Sub divideee()
counter = 0
For Each cell In Selection
For i = 1 To 4
cell.Offset(3 * counter + i - 1, 6) = cell.Offset(0, i - 1)
Next i
counter = counter + 1
Next cell
End Sub

HIH



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 100
Default How do I convert a table into a list in excel?

Hi,

Because I'm useless at VBA, I often resort to formula-based solutions to
problems like this, even though they look quite clumsy.
Here is what I use, assuming data is in columns A to D, then in E1, enter

=INDIRECT(IF(MOD(ROW(),4)=1,"A",IF(MOD(ROW(),4)=2, "B",(IF(MOD(ROW(),4)=3,"C",
"D"))))&ROUNDUP(ROW()/4,0))

and copy down.

Dave

url:http://www.ureader.com/msg/104235613.aspx
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How do I convert a table into a list in excel?

select yr resultant column

Sub formattt()
For i = 2 To 200000 Step 4
Cells(i, 1).NumberFormat = "0.00"
Next i
End Sub

adjust 200000 (maximum row number) as needed
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How do I convert a table into a list in excel?

sorry

should be:

select yr resultant column

Sub formattt()
For i = 2 To 200000 Step 4
Cells(i, 6).NumberFormat = "0.00"
Next i
End Sub

if the result is still in column 6
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default How do I convert a table into a list in excel?

Only the second column in the range is a numeric cell the rest are text.
Does that effect the output? This macro gave me a runtime error when put
into the sheet.

Run-Time error '1004'
Application-defined or object-defined error

How can I correct this error?

Thanks for your help.

"Jarek Kujawa" wrote:

sorry

should be:

select yr resultant column

Sub formattt()
For i = 2 To 200000 Step 4
Cells(i, 6).NumberFormat = "0.00"
Next i
End Sub

if the result is still in column 6

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
Convert list to table Phelit Excel Discussion (Misc queries) 1 May 28th 08 04:09 PM
Convert a formatted table back to a list marcopolo Excel Discussion (Misc queries) 0 March 20th 08 03:08 PM
How to convert a table to list? ferdi Excel Worksheet Functions 1 March 17th 07 03:14 AM
How to convert existing Excel List into a table in Access? anna New Users to Excel 2 June 18th 06 11:57 PM
convert excel list to pivot table GI Excel Discussion (Misc queries) 0 December 6th 04 06:45 PM


All times are GMT +1. The time now is 11:33 AM.

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"