Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have data in six columns (A-F) an Excel spreadsheet. See the duplicate
number 82131400? I want to leave the first 82131400 line alone, but move the data from second and third *400 rows onto the same row as the first *400 number but into columns (G-R). Possible with a macro? thanks. 82129735 8/31/2006 -120502 1-SO 8/30/2006 8/31/2006 82131400 8/31/2006 -121401 1-SO 8/31/2006 8/31/2006 82131400 LDR802- L/D 8/31/2006 8/31/2006 82131400 LDR901- L/D 8/31/2006 8/31/2006 82128158 8/31/2006 -313101 3-NO 8/29/2006 8/31/2006 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Look at this: Sub test() Dim StartCell As Range Dim CopyCell As Range Dim off As Long Set StartCell = Range("A1") ' assuming no headers Set CopyCell = StartCell.Offset(1, 1) Do Until StartCell.Offset(1, 0) = "" If StartCell.Offset(1, 0).Value = StartCell.Value Then Range(CopyCell.Address, CopyCell.End(xlToRight).Address).Copy _ Destination:=StartCell.End(xlToRight).Offset(0, 1) StartCell.Offset(1, 0).EntireRow.Delete Set CopyCell = StartCell.Offset(1, 1) Else Set StartCell = StartCell.Offset(1, 0) Set CopyCell = CopyCell.Offset(1, 0) End If Loop End Sub Regards, Per "cbart" skrev i meddelelsen ... I have data in six columns (A-F) an Excel spreadsheet. See the duplicate number 82131400? I want to leave the first 82131400 line alone, but move the data from second and third *400 rows onto the same row as the first *400 number but into columns (G-R). Possible with a macro? thanks. 82129735 8/31/2006 -120502 1-SO 8/30/2006 8/31/2006 82131400 8/31/2006 -121401 1-SO 8/31/2006 8/31/2006 82131400 LDR802- L/D 8/31/2006 8/31/2006 82131400 LDR901- L/D 8/31/2006 8/31/2006 82128158 8/31/2006 -313101 3-NO 8/29/2006 8/31/2006 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you so much!!!
"Per Jessen" wrote: Hi Look at this: Sub test() Dim StartCell As Range Dim CopyCell As Range Dim off As Long Set StartCell = Range("A1") ' assuming no headers Set CopyCell = StartCell.Offset(1, 1) Do Until StartCell.Offset(1, 0) = "" If StartCell.Offset(1, 0).Value = StartCell.Value Then Range(CopyCell.Address, CopyCell.End(xlToRight).Address).Copy _ Destination:=StartCell.End(xlToRight).Offset(0, 1) StartCell.Offset(1, 0).EntireRow.Delete Set CopyCell = StartCell.Offset(1, 1) Else Set StartCell = StartCell.Offset(1, 0) Set CopyCell = CopyCell.Offset(1, 0) End If Loop End Sub Regards, Per "cbart" skrev i meddelelsen ... I have data in six columns (A-F) an Excel spreadsheet. See the duplicate number 82131400? I want to leave the first 82131400 line alone, but move the data from second and third *400 rows onto the same row as the first *400 number but into columns (G-R). Possible with a macro? thanks. 82129735 8/31/2006 -120502 1-SO 8/30/2006 8/31/2006 82131400 8/31/2006 -121401 1-SO 8/31/2006 8/31/2006 82131400 LDR802- L/D 8/31/2006 8/31/2006 82131400 LDR901- L/D 8/31/2006 8/31/2006 82128158 8/31/2006 -313101 3-NO 8/29/2006 8/31/2006 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro to copy and paste values (columns)I have a macro file built | Excel Programming | |||
AutoRun Macro with a delay to give user the choice to cancel the macro | Excel Programming | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |