Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Transpose Question


New to this forum, and am looking for a little help. I have some data I
am looking to transpose, and need some suggestions on how to do this
more quickly. My data set is a daily data set that is organized into
rows. There are 11 values for the first two rows, and anywhere from 6
to 9 values in the 3rd row. I need these three rows transposed into
one column, and then the process is repeated for 11 more sets of 3
rows, all transposed into the same column. The next 12 sets of 3 rows
would go in column 2, followed by the next 12 sets of 3 rows going into
column 3, and so on.

To clarify what the data is, it is daily values, with January 1-11 in
row 1, 12-22 in row 2, and 23-31 in row 3, followed by February with
the next set of 3 rows, March with the next set, etc... I realize I
could take each row, copy, then paste special, and chose transpose, but
considering the number of years this set involves (from 1896-present),
there has to be an easier way. Can anyone help with a script? Any
help is much appreciated. :)


--
clollar
------------------------------------------------------------------------
clollar's Profile: http://www.excelforum.com/member.php...o&userid=34014
View this thread: http://www.excelforum.com/showthread...hreadid=537780

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Transpose Question

Sub Transpose()
Dim sh As Worksheet
Dim sh1 As Worksheet
Dim i As Long, j As Long
Dim i1 As Long, lastrow As Long
Set sh = ActiveSheet
i = 1
j = 1
i1 = 1
Set sh1 = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
lastrow = sh.Cells(Rows.Count, 1).End(xlUp).Row
Do While i <= lastrow
If Not IsEmpty(sh.Cells(i, j)) Then
sh1.Cells(i1, 1) = sh.Cells(i, j).Value
i1 = i1 + 1
j = j + 1
Else
i = i + 1
j = 1
End If
Loop
End Sub

--
Regards,
Tom Ogilvy



"clollar" wrote:


New to this forum, and am looking for a little help. I have some data I
am looking to transpose, and need some suggestions on how to do this
more quickly. My data set is a daily data set that is organized into
rows. There are 11 values for the first two rows, and anywhere from 6
to 9 values in the 3rd row. I need these three rows transposed into
one column, and then the process is repeated for 11 more sets of 3
rows, all transposed into the same column. The next 12 sets of 3 rows
would go in column 2, followed by the next 12 sets of 3 rows going into
column 3, and so on.

To clarify what the data is, it is daily values, with January 1-11 in
row 1, 12-22 in row 2, and 23-31 in row 3, followed by February with
the next set of 3 rows, March with the next set, etc... I realize I
could take each row, copy, then paste special, and chose transpose, but
considering the number of years this set involves (from 1896-present),
there has to be an easier way. Can anyone help with a script? Any
help is much appreciated. :)


--
clollar
------------------------------------------------------------------------
clollar's Profile: http://www.excelforum.com/member.php...o&userid=34014
View this thread: http://www.excelforum.com/showthread...hreadid=537780


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Transpose Question


Tom,

Thanks a ton for the quick response. This worked to take all rows and
combine into one column. Is there an easy way to take x number of rows
and combine into column 1, followed by x number of rows (same value of
x) and combine into column 2, and so on using a script? In this case,
I am talking about 36 rows = 1 column. So the first 36 rows would go
in column 1, the next 36 rows (37-72) would go in column 2, and so on.

Again, thanks again for your quick response. :)

Tom Ogilvy Wrote:
Sub Transpose()
Dim sh As Worksheet
Dim sh1 As Worksheet
Dim i As Long, j As Long
Dim i1 As Long, lastrow As Long
Set sh = ActiveSheet
i = 1
j = 1
i1 = 1
Set sh1 = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
lastrow = sh.Cells(Rows.Count, 1).End(xlUp).Row
Do While i <= lastrow
If Not IsEmpty(sh.Cells(i, j)) Then
sh1.Cells(i1, 1) = sh.Cells(i, j).Value
i1 = i1 + 1
j = j + 1
Else
i = i + 1
j = 1
End If
Loop
End Sub

--
Regards,
Tom Ogilvy



"clollar" wrote:


New to this forum, and am looking for a little help. I have some

data I
am looking to transpose, and need some suggestions on how to do this
more quickly. My data set is a daily data set that is organized

into
rows. There are 11 values for the first two rows, and anywhere from

6
to 9 values in the 3rd row. I need these three rows transposed into
one column, and then the process is repeated for 11 more sets of 3
rows, all transposed into the same column. The next 12 sets of 3

rows
would go in column 2, followed by the next 12 sets of 3 rows going

into
column 3, and so on.

To clarify what the data is, it is daily values, with January 1-11

in
row 1, 12-22 in row 2, and 23-31 in row 3, followed by February with
the next set of 3 rows, March with the next set, etc... I realize I
could take each row, copy, then paste special, and chose transpose,

but
considering the number of years this set involves (from

1896-present),
there has to be an easier way. Can anyone help with a script? Any
help is much appreciated. :)


--
clollar

------------------------------------------------------------------------
clollar's Profile:

http://www.excelforum.com/member.php...o&userid=34014
View this thread:

http://www.excelforum.com/showthread...hreadid=537780




--
clollar
------------------------------------------------------------------------
clollar's Profile: http://www.excelforum.com/member.php...o&userid=34014
View this thread: http://www.excelforum.com/showthread...hreadid=537780

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Transpose Question



Sub Transpose1()
Dim sh As Worksheet
Dim sh1 As Worksheet
Dim i As Long, j As Long
Dim i1 As Long, lastrow As Long
Dim j1 As Long
Set sh = ActiveSheet
i = 1
j = 1
i1 = 1
j1 = 1
Set sh1 = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
lastrow = sh.Cells(Rows.Count, 1).End(xlUp).Row
Do While i <= lastrow
If Not IsEmpty(sh.Cells(i, j)) Then
sh1.Cells(i1, j1) = sh.Cells(i, j).Value
i1 = i1 + 1
j = j + 1
Else
i = i + 1
If i Mod 36 = 1 Then
j1 = j1 + 1
i1 = 1
End If
j = 1
End If
Loop
End Sub
--
Regards,
Tom Ogilvy



"clollar" wrote:


Tom,

Thanks a ton for the quick response. This worked to take all rows and
combine into one column. Is there an easy way to take x number of rows
and combine into column 1, followed by x number of rows (same value of
x) and combine into column 2, and so on using a script? In this case,
I am talking about 36 rows = 1 column. So the first 36 rows would go
in column 1, the next 36 rows (37-72) would go in column 2, and so on.

Again, thanks again for your quick response. :)

Tom Ogilvy Wrote:
Sub Transpose()
Dim sh As Worksheet
Dim sh1 As Worksheet
Dim i As Long, j As Long
Dim i1 As Long, lastrow As Long
Set sh = ActiveSheet
i = 1
j = 1
i1 = 1
Set sh1 = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
lastrow = sh.Cells(Rows.Count, 1).End(xlUp).Row
Do While i <= lastrow
If Not IsEmpty(sh.Cells(i, j)) Then
sh1.Cells(i1, 1) = sh.Cells(i, j).Value
i1 = i1 + 1
j = j + 1
Else
i = i + 1
j = 1
End If
Loop
End Sub

--
Regards,
Tom Ogilvy



"clollar" wrote:


New to this forum, and am looking for a little help. I have some

data I
am looking to transpose, and need some suggestions on how to do this
more quickly. My data set is a daily data set that is organized

into
rows. There are 11 values for the first two rows, and anywhere from

6
to 9 values in the 3rd row. I need these three rows transposed into
one column, and then the process is repeated for 11 more sets of 3
rows, all transposed into the same column. The next 12 sets of 3

rows
would go in column 2, followed by the next 12 sets of 3 rows going

into
column 3, and so on.

To clarify what the data is, it is daily values, with January 1-11

in
row 1, 12-22 in row 2, and 23-31 in row 3, followed by February with
the next set of 3 rows, March with the next set, etc... I realize I
could take each row, copy, then paste special, and chose transpose,

but
considering the number of years this set involves (from

1896-present),
there has to be an easier way. Can anyone help with a script? Any
help is much appreciated. :)


--
clollar

------------------------------------------------------------------------
clollar's Profile:

http://www.excelforum.com/member.php...o&userid=34014
View this thread:

http://www.excelforum.com/showthread...hreadid=537780




--
clollar
------------------------------------------------------------------------
clollar's Profile: http://www.excelforum.com/member.php...o&userid=34014
View this thread: http://www.excelforum.com/showthread...hreadid=537780


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Transpose Question


Tom, you are a godsend! Thanks a ton! :

--
clolla
-----------------------------------------------------------------------
clollar's Profile: http://www.excelforum.com/member.php...fo&userid=3401
View this thread: http://www.excelforum.com/showthread.php?threadid=53778



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
Transpose Question: Column to Multiple Rows TekMarc Excel Discussion (Misc queries) 0 February 21st 11 05:01 PM
Transpose Question carl Excel Worksheet Functions 2 June 8th 06 06:58 PM
transpose or indirect question aaaa Excel Discussion (Misc queries) 0 May 8th 06 11:32 AM
Resize and Transpose question. Ken Johnson Excel Programming 2 April 26th 06 03:45 PM
Further Question about Transpose Florence Excel Worksheet Functions 3 June 6th 05 06:58 AM


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

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"