Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
TJN TJN is offline
external usenet poster
 
Posts: 10
Default Movve data from rows to columns

I have the following spreadsheet format:
Entity # Entity Name Acct # 1 Acct #2 Acct #3 Acct #4 Acct #5 ... Acct #28
12345 Entity 12345 100.00 300.00 250.00 200.00 500.00
700.00
23456 Entity 23456 600.00 500.00 700.00 400.00 600.00
900.00
Etc.

There are 28 different accounts plus the entity number and name columns for
a total of 30 columns. There will be upwards of 300 rows representing the
various entities. I need to get the data into a column format similar to the
following in order to sort it against data from another program. I need the
above data to look more like:

Entity # Account # Amount
12345 Acct #1 100.00
12345 Acct # 2 300.00
12345 Acct # 3 250.00
12345 Acct # 4 200.00
12345 Acct # 5 500.00
12345 Acct #28 700.00
23456 Acct # 1 600.00
23456 Acct # 2 500.00
23456 Acct # 3 700.00
23456 Acct # 4 400.00
23456 Acct # 5 600.00
23456 Acct #28 900.00
Etc.

When done there would be approx 8400 rows (28 columns of accts moved into
rows x the approx 300 entities).

Any ideas?

Thanks,

Tim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Movve data from rows to columns


search for "Tabular to CSV style layout" in this NG
you'll find some code from me from June 28th.
which should work.

if not let me know.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


TJN wrote :

I have the following spreadsheet format:
Entity # Entity Name Acct # 1 Acct #2 Acct #3 Acct #4 Acct #5 ...
Acct #28 12345 Entity 12345 100.00 300.00 250.00 200.00
500.00 700.00
23456 Entity 23456 600.00 500.00 700.00 400.00 600.00
900.00
Etc.

There are 28 different accounts plus the entity number and name
columns for a total of 30 columns. There will be upwards of 300 rows
representing the various entities. I need to get the data into a
column format similar to the following in order to sort it against
data from another program. I need the above data to look more like:

Entity # Account # Amount
12345 Acct #1 100.00
12345 Acct # 2 300.00
12345 Acct # 3 250.00
12345 Acct # 4 200.00
12345 Acct # 5 500.00
12345 Acct #28 700.00
23456 Acct # 1 600.00
23456 Acct # 2 500.00
23456 Acct # 3 700.00
23456 Acct # 4 400.00
23456 Acct # 5 600.00
23456 Acct #28 900.00
Etc.

When done there would be approx 8400 rows (28 columns of accts moved
into rows x the approx 300 entities).

Any ideas?

Thanks,

Tim

  #3   Report Post  
Posted to microsoft.public.excel.programming
TJN TJN is offline
external usenet poster
 
Posts: 10
Default Movve data from rows to columns

I'll give it a try. Thanks, Tim

"keepITcool" wrote:


search for "Tabular to CSV style layout" in this NG
you'll find some code from me from June 28th.
which should work.

if not let me know.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


TJN wrote :

I have the following spreadsheet format:
Entity # Entity Name Acct # 1 Acct #2 Acct #3 Acct #4 Acct #5 ...
Acct #28 12345 Entity 12345 100.00 300.00 250.00 200.00
500.00 700.00
23456 Entity 23456 600.00 500.00 700.00 400.00 600.00
900.00
Etc.

There are 28 different accounts plus the entity number and name
columns for a total of 30 columns. There will be upwards of 300 rows
representing the various entities. I need to get the data into a
column format similar to the following in order to sort it against
data from another program. I need the above data to look more like:

Entity # Account # Amount
12345 Acct #1 100.00
12345 Acct # 2 300.00
12345 Acct # 3 250.00
12345 Acct # 4 200.00
12345 Acct # 5 500.00
12345 Acct #28 700.00
23456 Acct # 1 600.00
23456 Acct # 2 500.00
23456 Acct # 3 700.00
23456 Acct # 4 400.00
23456 Acct # 5 600.00
23456 Acct #28 900.00
Etc.

When done there would be approx 8400 rows (28 columns of accts moved
into rows x the approx 300 entities).

Any ideas?

Thanks,

Tim


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Movve data from rows to columns

Looks like you are going to have to cycle through each row.
Have the input data on Sheet1 and export to Sheet2

[this code not tested and it could be simplified]
' indicates notes

Sub TransferMyData
Dim lrw1 as Long, lrw2 as Long, rng as Range, col1 as Long, col as Long

' build captions
with Worksheets("Sheet2")
.Cells(1,1) = "Entity #"
.Cells(1,2) = "Account #"
.Cells(1,3) = "Amount"
end with

' Find last cell in data, last row, and last col
Set rng = Worksheets("Sheet1").Cells.SpecialCells(xlLastCell )
col = rng.Column
lrw1 = rng.Row

' loop through all cells in data
For rw

--
steveB

Remove "AYN" from email to respond
"TJN" wrote in message
...
I have the following spreadsheet format:
Entity # Entity Name Acct # 1 Acct #2 Acct #3 Acct #4 Acct #5 ... Acct
#28
12345 Entity 12345 100.00 300.00 250.00 200.00 500.00
700.00
23456 Entity 23456 600.00 500.00 700.00 400.00 600.00
900.00
Etc.

There are 28 different accounts plus the entity number and name columns
for
a total of 30 columns. There will be upwards of 300 rows representing the
various entities. I need to get the data into a column format similar to
the
following in order to sort it against data from another program. I need
the
above data to look more like:

Entity # Account # Amount
12345 Acct #1 100.00
12345 Acct # 2 300.00
12345 Acct # 3 250.00
12345 Acct # 4 200.00
12345 Acct # 5 500.00
12345 Acct #28 700.00
23456 Acct # 1 600.00
23456 Acct # 2 500.00
23456 Acct # 3 700.00
23456 Acct # 4 400.00
23456 Acct # 5 600.00
23456 Acct #28 900.00
Etc.

When done there would be approx 8400 rows (28 columns of accts moved into
rows x the approx 300 entities).

Any ideas?

Thanks,

Tim




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Movve data from rows to columns

Sorry, ran out of time and didn't finish the code.
Will try to come back to it tomorrow
unless some one else is kind enough to step in...

--
steveB

Remove "AYN" from email to respond
"STEVE BELL" wrote in message
news:jVCze.499$ao6.114@trnddc05...
Looks like you are going to have to cycle through each row.
Have the input data on Sheet1 and export to Sheet2

[this code not tested and it could be simplified]
' indicates notes

Sub TransferMyData
Dim lrw1 as Long, lrw2 as Long, rng as Range, col1 as Long, col as Long

' build captions
with Worksheets("Sheet2")
.Cells(1,1) = "Entity #"
.Cells(1,2) = "Account #"
.Cells(1,3) = "Amount"
end with

' Find last cell in data, last row, and last col
Set rng = Worksheets("Sheet1").Cells.SpecialCells(xlLastCell )
col = rng.Column
lrw1 = rng.Row

' loop through all cells in data
For rw

--
steveB

Remove "AYN" from email to respond
"TJN" wrote in message
...
I have the following spreadsheet format:
Entity # Entity Name Acct # 1 Acct #2 Acct #3 Acct #4 Acct #5 ...
Acct #28
12345 Entity 12345 100.00 300.00 250.00 200.00 500.00
700.00
23456 Entity 23456 600.00 500.00 700.00 400.00 600.00
900.00
Etc.

There are 28 different accounts plus the entity number and name columns
for
a total of 30 columns. There will be upwards of 300 rows representing
the
various entities. I need to get the data into a column format similar to
the
following in order to sort it against data from another program. I need
the
above data to look more like:

Entity # Account # Amount
12345 Acct #1 100.00
12345 Acct # 2 300.00
12345 Acct # 3 250.00
12345 Acct # 4 200.00
12345 Acct # 5 500.00
12345 Acct #28 700.00
23456 Acct # 1 600.00
23456 Acct # 2 500.00
23456 Acct # 3 700.00
23456 Acct # 4 400.00
23456 Acct # 5 600.00
23456 Acct #28 900.00
Etc.

When done there would be approx 8400 rows (28 columns of accts moved into
rows x the approx 300 entities).

Any ideas?

Thanks,

Tim








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Movve data from rows to columns

Sorry for the delay
See if this works for you.
Change Sheet1 & Sheet2 to the name of your worksheets

Sub TransferMyData()
Dim lrw1 As Long, lrw2 As Long, rng As Range, col1 As Long, col As Long

Application.ScreenUpdating = False

' build captions
With Worksheets("Sheet2")
.Cells(1, 1) = "Entity #"
.Cells(1, 2) = "Account #"
.Cells(1, 3) = "Amount"
End With

' Find last last row
lrw1 = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row

' loop through all rows in data
For rw = 2 To lrw1
' loop through all columns
For col = 3 To 28
If Worksheets("Sheet1").Cells(rw, col) 0 Then
lrw2 = Worksheets("Sheet2").Cells(Rows.Count,
"A").End(xlUp).Row
With Worksheets("Sheet2")
.Cells(lrw2, 1) = Worksheets("Sheet1").Cells(rw, 1)
.Cells(lrw2, 2) = Worksheets("Sheet1").Cells(rw, 2)
.Cells(lrw2, 1) = Worksheets("Sheet1").Cells(rw, col)
End With
Next
Next

Application.ScreenUpdating = True
End Sub


--
steveB

Remove "AYN" from email to respond
"STEVE BELL" wrote in message
news:bXCze.500$ao6.38@trnddc05...
Sorry, ran out of time and didn't finish the code.
Will try to come back to it tomorrow
unless some one else is kind enough to step in...

--
steveB

Remove "AYN" from email to respond
"STEVE BELL" wrote in message
news:jVCze.499$ao6.114@trnddc05...
Looks like you are going to have to cycle through each row.
Have the input data on Sheet1 and export to Sheet2

[this code not tested and it could be simplified]
' indicates notes

Sub TransferMyData
Dim lrw1 as Long, lrw2 as Long, rng as Range, col1 as Long, col as Long

' build captions
with Worksheets("Sheet2")
.Cells(1,1) = "Entity #"
.Cells(1,2) = "Account #"
.Cells(1,3) = "Amount"
end with

' Find last cell in data, last row, and last col
Set rng = Worksheets("Sheet1").Cells.SpecialCells(xlLastCell )
col = rng.Column
lrw1 = rng.Row

' loop through all cells in data
For rw

--
steveB

Remove "AYN" from email to respond
"TJN" wrote in message
...
I have the following spreadsheet format:
Entity # Entity Name Acct # 1 Acct #2 Acct #3 Acct #4 Acct #5 ...
Acct #28
12345 Entity 12345 100.00 300.00 250.00 200.00 500.00
700.00
23456 Entity 23456 600.00 500.00 700.00 400.00 600.00
900.00
Etc.

There are 28 different accounts plus the entity number and name columns
for
a total of 30 columns. There will be upwards of 300 rows representing
the
various entities. I need to get the data into a column format similar
to the
following in order to sort it against data from another program. I need
the
above data to look more like:

Entity # Account # Amount
12345 Acct #1 100.00
12345 Acct # 2 300.00
12345 Acct # 3 250.00
12345 Acct # 4 200.00
12345 Acct # 5 500.00
12345 Acct #28 700.00
23456 Acct # 1 600.00
23456 Acct # 2 500.00
23456 Acct # 3 700.00
23456 Acct # 4 400.00
23456 Acct # 5 600.00
23456 Acct #28 900.00
Etc.

When done there would be approx 8400 rows (28 columns of accts moved
into
rows x the approx 300 entities).

Any ideas?

Thanks,

Tim








  #7   Report Post  
Posted to microsoft.public.excel.programming
TJN TJN is offline
external usenet poster
 
Posts: 10
Default Movve data from rows to columns

Thank you both. This gets me a huge step closer to getting my project done.

"STEVE BELL" wrote:

Sorry for the delay
See if this works for you.
Change Sheet1 & Sheet2 to the name of your worksheets

Sub TransferMyData()
Dim lrw1 As Long, lrw2 As Long, rng As Range, col1 As Long, col As Long

Application.ScreenUpdating = False

' build captions
With Worksheets("Sheet2")
.Cells(1, 1) = "Entity #"
.Cells(1, 2) = "Account #"
.Cells(1, 3) = "Amount"
End With

' Find last last row
lrw1 = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row

' loop through all rows in data
For rw = 2 To lrw1
' loop through all columns
For col = 3 To 28
If Worksheets("Sheet1").Cells(rw, col) 0 Then
lrw2 = Worksheets("Sheet2").Cells(Rows.Count,
"A").End(xlUp).Row
With Worksheets("Sheet2")
.Cells(lrw2, 1) = Worksheets("Sheet1").Cells(rw, 1)
.Cells(lrw2, 2) = Worksheets("Sheet1").Cells(rw, 2)
.Cells(lrw2, 1) = Worksheets("Sheet1").Cells(rw, col)
End With
Next
Next

Application.ScreenUpdating = True
End Sub


--
steveB

Remove "AYN" from email to respond
"STEVE BELL" wrote in message
news:bXCze.500$ao6.38@trnddc05...
Sorry, ran out of time and didn't finish the code.
Will try to come back to it tomorrow
unless some one else is kind enough to step in...

--
steveB

Remove "AYN" from email to respond
"STEVE BELL" wrote in message
news:jVCze.499$ao6.114@trnddc05...
Looks like you are going to have to cycle through each row.
Have the input data on Sheet1 and export to Sheet2

[this code not tested and it could be simplified]
' indicates notes

Sub TransferMyData
Dim lrw1 as Long, lrw2 as Long, rng as Range, col1 as Long, col as Long

' build captions
with Worksheets("Sheet2")
.Cells(1,1) = "Entity #"
.Cells(1,2) = "Account #"
.Cells(1,3) = "Amount"
end with

' Find last cell in data, last row, and last col
Set rng = Worksheets("Sheet1").Cells.SpecialCells(xlLastCell )
col = rng.Column
lrw1 = rng.Row

' loop through all cells in data
For rw

--
steveB

Remove "AYN" from email to respond
"TJN" wrote in message
...
I have the following spreadsheet format:
Entity # Entity Name Acct # 1 Acct #2 Acct #3 Acct #4 Acct #5 ...
Acct #28
12345 Entity 12345 100.00 300.00 250.00 200.00 500.00
700.00
23456 Entity 23456 600.00 500.00 700.00 400.00 600.00
900.00
Etc.

There are 28 different accounts plus the entity number and name columns
for
a total of 30 columns. There will be upwards of 300 rows representing
the
various entities. I need to get the data into a column format similar
to the
following in order to sort it against data from another program. I need
the
above data to look more like:

Entity # Account # Amount
12345 Acct #1 100.00
12345 Acct # 2 300.00
12345 Acct # 3 250.00
12345 Acct # 4 200.00
12345 Acct # 5 500.00
12345 Acct #28 700.00
23456 Acct # 1 600.00
23456 Acct # 2 500.00
23456 Acct # 3 700.00
23456 Acct # 4 400.00
23456 Acct # 5 600.00
23456 Acct #28 900.00
Etc.

When done there would be approx 8400 rows (28 columns of accts moved
into
rows x the approx 300 entities).

Any ideas?

Thanks,

Tim









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
Insert many columns with many rows AFTER data has already been typ CLR Excel Discussion (Misc queries) 0 March 30th 09 04:12 PM
Data from rows into columns Dave Excel Discussion (Misc queries) 1 February 11th 08 02:35 PM
Arrange data spanning 8 columns and 3 rows to 24 columns and 1 row pfdino Excel Discussion (Misc queries) 2 March 19th 07 09:03 PM
Data from Rows into columns BCLivell Excel Discussion (Misc queries) 7 May 8th 06 08:27 PM


All times are GMT +1. The time now is 03:19 AM.

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

About Us

"It's about Microsoft Excel"