View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

Mitch
You're probably falling victim to line wrapping in these messages. That
is always a problem. The line of code that looks like:
Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Transpose:=True
must be all on one line. Note that there must be a space before the word
Transpose. Post back and tell us if this works for you. Otto

"Mitch" wrote in message
...
Otto-
I took the colon out after TRANSPOSE. Now although the macro runs, all it
does is take the first name and address listed in column A and duplicates
it
in column B. It doesn't spread the data across B:D

I know you're close but I don't know enough about macros.

Mitch

"Otto Moehrbach" wrote:

This little macro should do what you want. As written, this macro
assumes
the data is in Column A and the first name is in A2. It also assumes
that
each "piece" of data consists of 3 cells bracketed by a blank cell above
it
and below it. This macro puts the product in Columns B:D starting in row
2.
Change these parameters in the code as needed to match your actual data.
HTH Otto
Sub TransposeAll()
Dim Source As Range
Set Source = Range("A2")
Do
Source.Resize(3).Copy
Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial
Transpose:=True
Set Source = Source.Offset(4)
Loop Until Source.Value = ""
End Sub

"Mitch" wrote in message
...
I have a column of repetitive data:

BLANK CELL
NAME
ADDRESS
CITY, STATE ZIP
BLANK CELL

I would like to be able to resort the dats so that each line becomes a
column
BLANK CELL NAME ADDRESS CITY, STATE ZIP
BLANK
CELL

I know I can do it 3 cells/rows at a time using the paste special and
transpose command but I have a 1000 names and addresses. How do I do it
in
one operation instead of a thousand?