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

Hi there! Could maybe someone help me to translate the following problem into
VBA ?

I need a code that helps me to tranpose data that I have in columns into
rows at each change of row:

Header1 Header2 July Aug Sep etc...

Name1 Object1 Data Data Data Data
Name2 Object2
Name3 Object3
etc... etc....

Need to get the following:

Header1 Header2

Name1 Object1 July Data
Name1 Object1 Aug Data
Name1 Object1 Sep Data
Name2 Object2 July Data

I hope this was clear :-)
I truly appreciate all the help.

Kind regards,
Fred
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Transpose macro

Sub makenewrows()

LastRow = Range("A" & Rows.Count).End(xlUp).Row

For RowCount = LastRow To 3 Step -1
LastCol = Cells(RowCount, Columns.Count).End(xlToLeft).Column
If LastCol 3 Then
For ColCount = LastCol To 4 Step -1
'insert new row
Rows(RowCount + 1).Insert
Range("A" & (RowCount + 1)) = _
Range("A" & RowCount)
Range("B" & (RowCount + 1)) = _
Range("B" & RowCount)
Range("C" & (RowCount + 1)) = _
Cells(1, ColCount)

Range("D" & (RowCount + 1)) = _
Cells(RowCount, ColCount)

Cells(RowCount, ColCount) = ""

Next ColCount
End If
'move column 3
Range("D" & RowCount) = _
Range("C" & RowCount)
Range("C" & RowCount) = Range("C1")
Next RowCount

End Sub


"Fred" wrote:

Hi there! Could maybe someone help me to translate the following problem into
VBA ?

I need a code that helps me to tranpose data that I have in columns into
rows at each change of row:

Header1 Header2 July Aug Sep etc...

Name1 Object1 Data Data Data Data
Name2 Object2
Name3 Object3
etc... etc....

Need to get the following:

Header1 Header2

Name1 Object1 July Data
Name1 Object1 Aug Data
Name1 Object1 Sep Data
Name2 Object2 July Data

I hope this was clear :-)
I truly appreciate all the help.

Kind regards,
Fred

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 or Macro? Buyone Excel Discussion (Misc queries) 7 November 5th 09 08:55 PM
Transpose macro bamf Excel Programming 1 July 25th 07 11:00 AM
Transpose Macro Spil Excel Worksheet Functions 1 July 14th 05 09:28 AM
help with transpose-like macro irato Excel Programming 7 February 19th 04 03:28 AM


All times are GMT +1. The time now is 01:00 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"