Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Bring values in a column into a row

I have a speadsheet with:-

1
23
4
5


34
4
3
5
6
2


2
3
4
3
2

I need the above info displayed
1 23 4 5
34 4 3 5 6 2
2 3 4 3 2

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Bring values in a column into a row

One way is to use a macro.. You can try out the below macro. If you are new
to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub MyMacro()
Dim lngRow As Long, lngNRow As Long, lngNCol As Long
For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Trim(Range("A" & lngRow)) < "" Then
lngNRow = lngNRow + 1
lngNCol = 1
Do While Trim(Range("A" & lngRow)) < ""
lngNCol = lngNCol + 1
Cells(lngNRow, lngNCol) = Range("A" & lngRow)
lngRow = lngRow + 1
Loop
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"peterh" wrote:

I have a speadsheet with:-

1
23
4
5


34
4
3
5
6
2


2
3
4
3
2

I need the above info displayed
1 23 4 5
34 4 3 5 6 2
2 3 4 3 2

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Bring values in a column into a row

Jacob, Thanks, I personaly didn't under stand, (don't do Macro's) but the
boss did & said it may help. Thanks again.


"Jacob Skaria" wrote:

One way is to use a macro.. You can try out the below macro. If you are new
to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub MyMacro()
Dim lngRow As Long, lngNRow As Long, lngNCol As Long
For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Trim(Range("A" & lngRow)) < "" Then
lngNRow = lngNRow + 1
lngNCol = 1
Do While Trim(Range("A" & lngRow)) < ""
lngNCol = lngNCol + 1
Cells(lngNRow, lngNCol) = Range("A" & lngRow)
lngRow = lngRow + 1
Loop
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"peterh" wrote:

I have a speadsheet with:-

1
23
4
5


34
4
3
5
6
2


2
3
4
3
2

I need the above info displayed
1 23 4 5
34 4 3 5 6 2
2 3 4 3 2

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Bring values in a column into a row

Jacob,

There seems to be a bug in this row
Do While Trim(Range("A" & lngRow)) < ""
and the compiler stops?

Please advise - Thanks Peter

"Jacob Skaria" wrote:

One way is to use a macro.. You can try out the below macro. If you are new
to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub MyMacro()
Dim lngRow As Long, lngNRow As Long, lngNCol As Long
For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Trim(Range("A" & lngRow)) < "" Then
lngNRow = lngNRow + 1
lngNCol = 1
Do While Trim(Range("A" & lngRow)) < ""
lngNCol = lngNCol + 1
Cells(lngNRow, lngNCol) = Range("A" & lngRow)
lngRow = lngRow + 1
Loop
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"peterh" wrote:

I have a speadsheet with:-

1
23
4
5


34
4
3
5
6
2


2
3
4
3
2

I need the above info displayed
1 23 4 5
34 4 3 5 6 2
2 3 4 3 2

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Bring values in a column into a row

I have tried this with several samples; but unable to recreate the error you
mentioned.

--Just copy the data to Column A
--The macro will transpose data in sets in Column B

1
23
4
5


34
4
3
5
6
2


2
3
4
3
2

3

32

'Transposed to
1 23 4 5
34 4 3 5 6 2
2 3 4 3 2
3
32


If this post helps click Yes
---------------
Jacob Skaria


"peterh" wrote:

Jacob,

There seems to be a bug in this row
Do While Trim(Range("A" & lngRow)) < ""
and the compiler stops?

Please advise - Thanks Peter

"Jacob Skaria" wrote:

One way is to use a macro.. You can try out the below macro. If you are new
to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub MyMacro()
Dim lngRow As Long, lngNRow As Long, lngNCol As Long
For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Trim(Range("A" & lngRow)) < "" Then
lngNRow = lngNRow + 1
lngNCol = 1
Do While Trim(Range("A" & lngRow)) < ""
lngNCol = lngNCol + 1
Cells(lngNRow, lngNCol) = Range("A" & lngRow)
lngRow = lngRow + 1
Loop
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"peterh" wrote:

I have a speadsheet with:-

1
23
4
5


34
4
3
5
6
2


2
3
4
3
2

I need the above info displayed
1 23 4 5
34 4 3 5 6 2
2 3 4 3 2



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Bring values in a column into a row

Hi,

Suppose the data below is in range B5:B26. In A5, enter 1, in cell A6,
etner =IF(AND(B5="",B6<""),MAX($A$5:A5)+1,IF(B6="","",A 5)) and copy till
A26. In F5:F7, enter 1,2,3. In cell G5, enter the following array formula
(Ctrl+Shift+Enter) and copy down and across

=IF(ISERROR(INDEX($A$5:$B$26,SMALL(IF($A$4:$A$26=$ F5,ROW($A$4:$A$26)-ROW($A$4)),COUNTA($F5:F5)),2)),"",INDEX($A$5:$B$26 ,SMALL(IF($A$4:$A$26=$F5,ROW($A$4:$A$26)-ROW($A$4)),COUNTA($F5:F5)),2))

Hope this helps

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"peterh" wrote in message
...
I have a speadsheet with:-

1
23
4
5


34
4
3
5
6
2


2
3
4
3
2

I need the above info displayed
1 23 4 5
34 4 3 5 6 2
2 3 4 3 2

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
lookup to bring back multiple values zakfalls Excel Worksheet Functions 3 May 28th 09 05:36 PM
Column Matching - Bring the entire row. vrk1 Excel Discussion (Misc queries) 4 May 6th 08 08:10 PM
formula needed to bring values to another sheet veena Excel Worksheet Functions 2 June 5th 07 05:58 PM
Bring a code from a cell to a column Manos Excel Worksheet Functions 2 December 17th 06 10:06 PM
Bring back lowercase values Pat Excel Worksheet Functions 3 October 3rd 06 06:16 PM


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