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

Hello All,
I am using Office XP and have the following problem.
The data is in the following format on Sheet1in Cols A, B and C and set of
Seven Rows.

A B C
1 Data1 Data2 <blank
2 Data4 Data5 Data6
3 Data7 Data8 <blank
4 Data9 Data10 <blank
5 Data11 Data12 Data13
6 Data14 <blank <blank
7 Data16 <blank <blank

(Row 8 is Blank)

Similar format of Seven Rows from Row 9 to 15 as above and then a blank row
(Row 16) followed by set of Seven Rows from Rows 17 to 23.......... and so
on.

I wish to transpose the data from Sheet1 to Sheet2 (columns) in the
following manner.
A B C D E F G
H I J K
Data1 Data2 <blank Data4 Data5 Data6 <blank Data7 Data8 <blank
Data9 ... till the last <blank

and repeat for the following set of Seven Rows. The <blank will never
appear in Col A but it can appear in Col B and/or Col C.

Can this be achieved thru VBA.. Any help or a better idea would be greatly
appreciated.

Thanks in advance

Rashid Khan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Transpose Columns to Rows

Sub TesterAA()
Dim cell As Range, rng1 As Range, rng As Range
Dim i As Long
Dim rw As Long
With Worksheets("Sheet1")
.Rows(1).Insert
Set rng = Columns(1).SpecialCells(xlBlanks)
End With
For Each cell In rng
rw = rw + 1
Set rng1 = cell.Offset(1, 0).Resize(7, 3)
For i = 1 To 21
Worksheets("Sheet2").Cells(rw, i).Value = _
rng1(i).Value
Next
Next
Worksheets("sheet1").Rows(1).Delete
End Sub

--
Regards,
Tom Ogilvy



"Rashid Khan" wrote in message
...
Hello All,
I am using Office XP and have the following problem.
The data is in the following format on Sheet1in Cols A, B and C and set of
Seven Rows.

A B C
1 Data1 Data2 <blank
2 Data4 Data5 Data6
3 Data7 Data8 <blank
4 Data9 Data10 <blank
5 Data11 Data12 Data13
6 Data14 <blank <blank
7 Data16 <blank <blank

(Row 8 is Blank)

Similar format of Seven Rows from Row 9 to 15 as above and then a blank

row
(Row 16) followed by set of Seven Rows from Rows 17 to 23.......... and so
on.

I wish to transpose the data from Sheet1 to Sheet2 (columns) in the
following manner.
A B C D E F G
H I J K
Data1 Data2 <blank Data4 Data5 Data6 <blank Data7 Data8 <blank
Data9 ... till the last <blank

and repeat for the following set of Seven Rows. The <blank will never
appear in Col A but it can appear in Col B and/or Col C.

Can this be achieved thru VBA.. Any help or a better idea would be greatly
appreciated.

Thanks in advance

Rashid Khan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Transpose Columns to Rows

Wow, You are a magician. It works like a magic wand.
Thanks a lot.
"Tom Ogilvy" wrote in message
...
Sub TesterAA()
Dim cell As Range, rng1 As Range, rng As Range
Dim i As Long
Dim rw As Long
With Worksheets("Sheet1")
.Rows(1).Insert
Set rng = Columns(1).SpecialCells(xlBlanks)
End With
For Each cell In rng
rw = rw + 1
Set rng1 = cell.Offset(1, 0).Resize(7, 3)
For i = 1 To 21
Worksheets("Sheet2").Cells(rw, i).Value = _
rng1(i).Value
Next
Next
Worksheets("sheet1").Rows(1).Delete
End Sub

--
Regards,
Tom Ogilvy



"Rashid Khan" wrote in message
...
Hello All,
I am using Office XP and have the following problem.
The data is in the following format on Sheet1in Cols A, B and C and set

of
Seven Rows.

A B C
1 Data1 Data2 <blank
2 Data4 Data5 Data6
3 Data7 Data8 <blank
4 Data9 Data10 <blank
5 Data11 Data12 Data13
6 Data14 <blank <blank
7 Data16 <blank <blank

(Row 8 is Blank)

Similar format of Seven Rows from Row 9 to 15 as above and then a blank

row
(Row 16) followed by set of Seven Rows from Rows 17 to 23.......... and

so
on.

I wish to transpose the data from Sheet1 to Sheet2 (columns) in the
following manner.
A B C D E F G
H I J K
Data1 Data2 <blank Data4 Data5 Data6 <blank Data7 Data8 <blank
Data9 ... till the last <blank

and repeat for the following set of Seven Rows. The <blank will never
appear in Col A but it can appear in Col B and/or Col C.

Can this be achieved thru VBA.. Any help or a better idea would be

greatly
appreciated.

Thanks in advance

Rashid Khan






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 ROWS TO COLUMNS excelhel_p Excel Discussion (Misc queries) 4 June 13th 09 08:18 AM
Transpose columns to rows using first columns repeated. hn7155 Excel Worksheet Functions 7 February 12th 09 11:50 PM
How do you transpose rows to columns? msn Excel Discussion (Misc queries) 6 September 1st 07 04:00 AM
How can I take information in rows and transpose it into columns? Lisa Excel Discussion (Misc queries) 1 September 21st 06 04:41 PM
how do I transpose columns and rows jnix Excel Discussion (Misc queries) 10 December 22nd 04 01:44 PM


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