Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mitch
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

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?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mitch
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

Thanks. You seem to understand exactly what I am trying to accomplish. I have
no specific knowledge regarding the macro you created for me but, what you
wrote me makes sense. When I ran the macro as written a window pops up and
Transpose:=True is in red. My assumption is that this means the macro bogged
down at this point. I dont know how to correct it. Maybe you could further
assist me, if possible.

Thank you in advance.



"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?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mitch
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

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?




  #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?








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

Do you need the blanks cells?

If not, select column and F5SpecialBlanksOKEditDeleteEntire Row

Then run this macro.

If you want the blanks, leave them and enter "5" in the "columns desired.
Otherwise, enter "3"

Sub ColtoRows()
Dim Rng As Range
Dim i As Long
Dim j As Long
Dim nocols As Integer
Set Rng = Cells(Rows.Count, 1).End(xlUp)
j = 1
nocols = InputBox("Enter Number of Columns Desired")

For i = 1 To Rng.Row Step nocols
Cells(j, "A").Resize(1, nocols).Value = _
Application.Transpose(Cells(i, "A").Resize(nocols, 1))
j = j + 1
Next
Range(Cells(j, "A"), Cells(Rng.Row, "A")).ClearContents
Exit Sub
End Sub


Gord Dibben MS Excel MVP


On Fri, 23 Jun 2006 09:55:02 -0700, Mitch
wrote:

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?


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mitch
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

Otto -

Thanks for the help but still no go. However Gord Dibbon posted a mocro that
did exactly what I needed.

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?




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mitch
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

Gord -

An absolute winner! Your macro did exactly what I needed it to do. Thanks a
million

Mitch

"Gord Dibben" wrote:

Do you need the blanks cells?

If not, select column and F5SpecialBlanksOKEditDeleteEntire Row

Then run this macro.

If you want the blanks, leave them and enter "5" in the "columns desired.
Otherwise, enter "3"

Sub ColtoRows()
Dim Rng As Range
Dim i As Long
Dim j As Long
Dim nocols As Integer
Set Rng = Cells(Rows.Count, 1).End(xlUp)
j = 1
nocols = InputBox("Enter Number of Columns Desired")

For i = 1 To Rng.Row Step nocols
Cells(j, "A").Resize(1, nocols).Value = _
Application.Transpose(Cells(i, "A").Resize(nocols, 1))
j = j + 1
Next
Range(Cells(j, "A"), Cells(Rng.Row, "A")).ClearContents
Exit Sub
End Sub


Gord Dibben MS Excel MVP


On Fri, 23 Jun 2006 09:55:02 -0700, Mitch
wrote:

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?



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

Thanks for the feedback Mitch.

BTW....what did you do with the blanks?


Gord

On Fri, 23 Jun 2006 15:44:01 -0700, Mitch
wrote:

Gord -

An absolute winner! Your macro did exactly what I needed it to do. Thanks a
million

Mitch

"Gord Dibben" wrote:

Do you need the blanks cells?

If not, select column and F5SpecialBlanksOKEditDeleteEntire Row

Then run this macro.

If you want the blanks, leave them and enter "5" in the "columns desired.
Otherwise, enter "3"

Sub ColtoRows()
Dim Rng As Range
Dim i As Long
Dim j As Long
Dim nocols As Integer
Set Rng = Cells(Rows.Count, 1).End(xlUp)
j = 1
nocols = InputBox("Enter Number of Columns Desired")

For i = 1 To Rng.Row Step nocols
Cells(j, "A").Resize(1, nocols).Value = _
Application.Transpose(Cells(i, "A").Resize(nocols, 1))
j = j + 1
Next
Range(Cells(j, "A"), Cells(Rng.Row, "A")).ClearContents
Exit Sub
End Sub


Gord Dibben MS Excel MVP


On Fri, 23 Jun 2006 09:55:02 -0700, Mitch
wrote:

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?




Gord Dibben MS Excel MVP
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mitch
 
Posts: n/a
Default SORT REPETITIVE DATA FROM ROWS TO COLUMNS

Gord -

Deleted them as per your instruction. Again, thanks a million. This savede
me hours of manual labor. I was prepared to enter the info manually into my
database if not for the workaround.

Mitch

"Gord Dibben" wrote:

Thanks for the feedback Mitch.

BTW....what did you do with the blanks?


Gord

On Fri, 23 Jun 2006 15:44:01 -0700, Mitch
wrote:

Gord -

An absolute winner! Your macro did exactly what I needed it to do. Thanks a
million

Mitch

"Gord Dibben" wrote:

Do you need the blanks cells?

If not, select column and F5SpecialBlanksOKEditDeleteEntire Row

Then run this macro.

If you want the blanks, leave them and enter "5" in the "columns desired.
Otherwise, enter "3"

Sub ColtoRows()
Dim Rng As Range
Dim i As Long
Dim j As Long
Dim nocols As Integer
Set Rng = Cells(Rows.Count, 1).End(xlUp)
j = 1
nocols = InputBox("Enter Number of Columns Desired")

For i = 1 To Rng.Row Step nocols
Cells(j, "A").Resize(1, nocols).Value = _
Application.Transpose(Cells(i, "A").Resize(nocols, 1))
j = j + 1
Next
Range(Cells(j, "A"), Cells(Rng.Row, "A")).ClearContents
Exit Sub
End Sub


Gord Dibben MS Excel MVP


On Fri, 23 Jun 2006 09:55:02 -0700, Mitch
wrote:

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?



Gord Dibben MS Excel MVP

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
Query doesn't add/delete data in rows on refresh boreal Excel Discussion (Misc queries) 2 October 12th 12 09:34 PM
Can I rotate data in Excel table (rows to columns, and vv)? Marcus Ricci Excel Discussion (Misc queries) 6 July 14th 08 04:11 PM
text data in one column many rows to many columns one row MoniqueL Excel Discussion (Misc queries) 1 March 14th 06 10:17 AM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM
sort column data with hidden columns - excel 2003 nanimadrina Excel Discussion (Misc queries) 2 April 26th 05 08:27 PM


All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"