Thread: Rows to Columns
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Rows to Columns

This is an old routine that I use to do this. I really need to
rewrite it, but it gets the job done. Be sure to test this on a copy
of your data before running it on your main data. Better safe than
sorry.
Sub SplitDups()
DupCol = InputBox("Seperate duplicates based on which column?", _
"Column Entry", ColumnLetter(ActiveCell.Column))
If DupCol = "" Then Exit Sub
Range(DupCol & "1").Name = "SortCol"
BotRow = Range("SortCol").End(xlDown).Row - 1
If ActiveCell = "" Then
MsgBox "You must be on the data you want sorted."
Exit Sub
End If
i = Range("IV1").End(xlToLeft).Column - Range("SortCol").Column
x = 1
Do
For y = 2 To i
If Trim(Range("SortCol").Offset(x, y)) < "" Then
Rows(x + 1).Copy
Rows(x + y).Insert Shift:=xlDown
Range("SortCol").Offset(x + y - 1, 1) = _
Range("SortCol").Offset(x, y)
j = j + 1
BotRow = BotRow + 1
End If
Next
x = x + 1 + j
j = 0
Loop Until x BotRow
Range(Range("SortCol").Offset(0, 2), _
Range("SortCol").Offset(0, i)).EntireColumn.Delete
End Sub
Buyone wrote:
Hi,

I get info coming in that is formatted :-
08-Aug 02:42
08-Aug 07:29 08:10 09:58 10:45 11:58 13:33
09-Aug 04:57
09-Aug 06:28 09:46 10:32 11:28 12:44 13:44

This goes on for the entire month. I need it formatted as:-
08-Aug 02:42
08-Aug 07:29
08-Aug 08:10
08-Aug 09:58
08-Aug 10:45
08-Aug 11:58

Etc.
Anyone got any ideas of a quick way of doing this?