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

Hi all,

I have given up trying this on my own and was hoping someone can help
with this - here's what I have going on:

I get an output of two columns from another software and paste it into
Excel. In Column A, there are numbers ranging from 1 to 1,000, often
repeating 2-5 times; in column B, I have random numbers. What I need
done is to in a way transpose the numbers for each of the repeating
ones in column A into a row. An example might be best:

Column A, Column B
1, 100
1, 234
1, 390
2, 900
2, 435
3, 67
3, 870
3, 670
3, 665
3, 890

With the list above, i want to achieve th follwing results:

1, 100, 234, 390
2, 900, 435
3, 67, 870, 670, 665, 890
and so on...

If you have any questions or need me to clarify further,please let me
know; I thank you in advance for your help.

Thanks!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Rearranging Data

Don,

Thank you so much for the code - it did the trick! I appreciate the
help!

Best regards,
-Haas


On Aug 26, 11:43*am, "Don Guillett" wrote:
try this

Sub lineuplikenums()
mc = 1
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i, mc) = Cells(i - 1, mc) Then
'MsgBox Cells(i - 1, mc + 1) & ", " & Cells(i, mc + 1)
Cells(i - 1, mc + 1).Value = _
Cells(i - 1, mc + 1) & ", " & Cells(i, mc + 1)
Rows(i).Delete
End If
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...



Hi all,


I have given up trying this on my own and was hoping someone can help
with this - here's what I have going on:


I get an output of two columns from another software and paste it into
Excel. In Column A, there are numbers ranging from 1 to 1,000, often
repeating 2-5 times; in column B, I have random numbers. What I need
done is to in a way transpose the numbers for each of the repeating
ones in column A into a row. An example might be best:


Column A, Column B
1, 100
1, 234
1, 390
2, 900
2, 435
3, 67
3, 870
3, 670
3, 665
3, 890


With the list above, i want to achieve th follwing results:


1, 100, 234, 390
2, 900, 435
3, 67, 870, 670, 665, 890
and so on...


If you have any questions or need me to clarify further,please let me
know; I thank you in advance for your help.


Thanks!- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Rearranging Data

Glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
Don,

Thank you so much for the code - it did the trick! I appreciate the
help!

Best regards,
-Haas


On Aug 26, 11:43 am, "Don Guillett" wrote:
try this

Sub lineuplikenums()
mc = 1
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i, mc) = Cells(i - 1, mc) Then
'MsgBox Cells(i - 1, mc + 1) & ", " & Cells(i, mc + 1)
Cells(i - 1, mc + 1).Value = _
Cells(i - 1, mc + 1) & ", " & Cells(i, mc + 1)
Rows(i).Delete
End If
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...



Hi all,


I have given up trying this on my own and was hoping someone can help
with this - here's what I have going on:


I get an output of two columns from another software and paste it into
Excel. In Column A, there are numbers ranging from 1 to 1,000, often
repeating 2-5 times; in column B, I have random numbers. What I need
done is to in a way transpose the numbers for each of the repeating
ones in column A into a row. An example might be best:


Column A, Column B
1, 100
1, 234
1, 390
2, 900
2, 435
3, 67
3, 870
3, 670
3, 665
3, 890


With the list above, i want to achieve th follwing results:


1, 100, 234, 390
2, 900, 435
3, 67, 870, 670, 665, 890
and so on...


If you have any questions or need me to clarify further,please let me
know; I thank you in advance for your help.


Thanks!- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Rearranging Data

I stored this one in my "goodies" add-in.

Thanks Don


Gord

On Tue, 26 Aug 2008 13:26:49 -0500, "Don Guillett"
wrote:

Glad to help




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Rearranging Data

From you a kind compliment. Thanks

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
I stored this one in my "goodies" add-in.

Thanks Don


Gord

On Tue, 26 Aug 2008 13:26:49 -0500, "Don Guillett"
wrote:

Glad to help



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 806
Default Rearranging Data

Hello,

I suggest to take my UDF vlookupall:
http://www.sulprobil.com/html/lookup-variants.html

Regards,
Bernd
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
Rearranging DATA raj74 Excel Discussion (Misc queries) 6 April 12th 09 12:11 PM
Rearranging data John Pierce Excel Programming 2 March 25th 08 12:59 PM
rearranging data Taru[_8_] Excel Programming 4 June 20th 06 01:33 PM
Rearranging Data HIT Engineering Excel Programming 1 April 18th 05 07:31 PM
Rearranging Data Help... Jambruins Excel Discussion (Misc queries) 0 February 22nd 05 03:31 PM


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