Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting data

Status
Not open for further replies.

Drej

Mechanical
Jul 31, 2002
971
Community,

I have numerical data in Excel in the following column format:

A B C D
E F G H
etc.

where A, B etc = a number

The data is 4 columns (A B C D) x 1251 rows. I would really like to have this data sorted into the format

A
B
C
D
...

Any ideas?

Many thanks.


------------
See faq569-1083 for details on how to make best use of Eng-Tips.com
 
Replies continue below

Recommended for you

Managed to do it in the end using the code below.

Code:
Sub sort_data()
'
' proper Macro

For j = 1 To 1251 Step 1
    Range(Cells(j, 1), Cells(j, 4)).Select
    Selection.Copy
    Range(Cells((j * 4) + 1, 6), Cells((j * 4) + 1, 6)).Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
    Next j
End Sub


------------
See faq569-1083 for details on how to make best use of Eng-Tips.com
 
In the Paste Special applet, there is a Transpose check box. I think this would do what you are describing.
 
You could also do the following:
Select your range (A1:D1251)
Copy
Select a new worksheet, cell A1
Right click, PasteSpecial - Transpose (at the bottom of the dialog box)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor