Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Transpose Multiple Rows to one

Hello,

I'm trying to change the format of my data. Ex:

apple 2
ab cd
orange 5
ef gh
banana 4
cd ef

And I want to get it to the format:

apple 2 ab cd
orange 5 ef gh
banana 4 cd ef

Is there an easy way to do that? I can't figure it out with transpose or the
offset function.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default Transpose Multiple Rows to one

try this

Sub rearrangeem()
Dim i As Long
lr = Cells(Rows.Count, 1).End(xlUp).Row
If lr / 2 < Int(lr / 2) Then lr = lr - 1
'MsgBox lr
For i = lr To 2 Step -2
Cells(i - 1, 3) = Cells(i, 1)
Cells(i - 1, 4) = Cells(i, 2)
Rows(i).Delete
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Demosthenes" wrote in message
...
Hello,

I'm trying to change the format of my data. Ex:

apple 2
ab cd
orange 5
ef gh
banana 4
cd ef

And I want to get it to the format:

apple 2 ab cd
orange 5 ef gh
banana 4 cd ef

Is there an easy way to do that? I can't figure it out with transpose or
the
offset function.

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Transpose Multiple Rows to one

Thanks, but I'd like to do it without using a macro. Do you know of another
way to do it?

"Don Guillett" wrote:

try this

Sub rearrangeem()
Dim i As Long
lr = Cells(Rows.Count, 1).End(xlUp).Row
If lr / 2 < Int(lr / 2) Then lr = lr - 1
'MsgBox lr
For i = lr To 2 Step -2
Cells(i - 1, 3) = Cells(i, 1)
Cells(i - 1, 4) = Cells(i, 2)
Rows(i).Delete
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Demosthenes" wrote in message
...
Hello,

I'm trying to change the format of my data. Ex:

apple 2
ab cd
orange 5
ef gh
banana 4
cd ef

And I want to get it to the format:

apple 2 ab cd
orange 5 ef gh
banana 4 cd ef

Is there an easy way to do that? I can't figure it out with transpose or
the
offset function.

Thanks!


.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Transpose Multiple Rows to one

With your test data in A1:B6, I used this:

In C1: =A2
In D1: =B2

Then I selected C1:D2 (4 cells!)
And dragged it down as far as I needed.

Then I selected columns C:D and converted to values.
(edit|copy followed by edit|paste special values)

Then I selected just column C
Edit|Goto (or ctrl-g)
special
Blanks
Edit|Delete|entirerow



Demosthenes wrote:

Hello,

I'm trying to change the format of my data. Ex:

apple 2
ab cd
orange 5
ef gh
banana 4
cd ef

And I want to get it to the format:

apple 2 ab cd
orange 5 ef gh
banana 4 cd ef

Is there an easy way to do that? I can't figure it out with transpose or the
offset function.

Thanks!


--

Dave Peterson
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 multiple Columns to rows Michelle Excel Worksheet Functions 8 March 5th 10 10:55 PM
how to transpose multiple rows into one column with row labeling? pemt Excel Discussion (Misc queries) 2 November 5th 09 10:03 PM
transpose multiple rows into one column pemt Excel Discussion (Misc queries) 2 October 23rd 09 10:27 PM
transpose multiple rows at once Narendra Boga[_2_] Excel Discussion (Misc queries) 4 June 9th 07 06:13 AM
Can you transpose 1 column into multiple rows creating a table Richard Excel Discussion (Misc queries) 6 November 2nd 06 09:46 PM


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