Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Sorting data

Sorting data

Sorting data


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

A   B   C   D
E   F   G   H

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


Any ideas?

Many thanks.

See FAQ569-1083 for details on how to make best use of Eng-Tips.com

RE: Sorting data

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


Sub sort_data()
' proper Macro

For j = 1 To 1251 Step 1
    Range(Cells(j, 1), Cells(j, 4)).Select
    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

RE: Sorting data

In the Paste Special applet, there is a Transpose check box.  I think this would do what you are describing.

RE: Sorting data

You could also do the following:
Select your range (A1:D1251)
Select a new worksheet, cell A1
Right click, PasteSpecial - Transpose (at the bottom of the dialog box)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close