ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rearrange sheet data (https://www.excelbanter.com/excel-programming/441666-rearrange-sheet-data.html)

C

Rearrange sheet data
 
I need some help to get my data rearranged in my sheet.


My spreadsheet contains Item Numbers and Customer Data. Column C to ?
contains Customer specific information..Location...etc..
Col A Col B Col C:?
Item # Customer Customer Specific information.
123 ABC Could be C:D or C:JJ
123 DEF
123 GHI
456 ABC
456 DEF

I would like to rearrange the data to the following columns:

Col A Col B
123
ABC Customer Specific info. C:?
DEF
GHI
456
ABC
DEF

One Item number could have 1 Customer or could have 1000 Customers.


I am not a VBAer, so any help would be appreciated.

Don Guillett[_2_]

Rearrange sheet data
 
Option Explicit
Sub compiledataSAS() 'Assumes A HEADER ROW
Application.ScreenUpdating = False
Dim i As Long
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 1) = Cells(i, 1) Then
Cells(i, 2).Cut Cells(i, 1)
Else
Cells(i, 2).Cut
Cells(i + 1, 1).Insert shift:=xlDown
End If
Next i
Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"C" wrote in message
...
I need some help to get my data rearranged in my sheet.


My spreadsheet contains Item Numbers and Customer Data. Column C to ?
contains Customer specific information..Location...etc..
Col A Col B Col C:?
Item # Customer Customer Specific information.
123 ABC Could be C:D or C:JJ
123 DEF
123 GHI
456 ABC
456 DEF

I would like to rearrange the data to the following columns:

Col A Col B
123
ABC Customer Specific info. C:?
DEF
GHI
456
ABC
DEF

One Item number could have 1 Customer or could have 1000 Customers.


I am not a VBAer, so any help would be appreciated.




All times are GMT +1. The time now is 01:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com