+ Reply to Thread
Results 1 to 11 of 11

Sorting from horizontal to vertical

  1. #1
    Registered User
    Join Date
    03-11-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    25

    Sorting from horizontal to vertical

    http://www.excelforum.com/images/smilies/frown.gif

    Dear All

    Need your help urgent. Am looking for a VBA or formula to do sorting from horizontal to vertical. Attached is a sample

    Beside this, the process should ignore the yellow highlighted cell. There were thousand of Product category and branch.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Sorting from horizontal to vertical

    Hello mambo84,
    1. Do you want a button on the worksheet to start the sort?
    2. Will the data to excluded be highlighted in yellow on the original document?
    3. If the data is not highlighted, how will the data to excluded be recognized?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    03-11-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Sorting from horizontal to vertical

    Quote Originally Posted by Leith Ross View Post
    Hello mambo84,
    1. Do you want a button on the worksheet to start the sort? Yes
    2. Will the data to excluded be highlighted in yellow on the original document?The data highlighted is to be excluded from the list and not the other way round
    3. If the data is not highlighted, how will the data to excluded be recognized? if the data is not highlighted, it must appear in horizontal list.

    Hi Leith Ross , please see the reply

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Sorting from horizontal to vertical

    Hello mambo84,

    What reply are you referring to? You quoted my last post. That does not answer my questions.

  5. #5
    Registered User
    Join Date
    03-11-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Sorting from horizontal to vertical

    [*] Do you want a button on the worksheet to start the sort? Yes[*] Will the data to excluded be highlighted in yellow on the original document?The data highlighted is to be excluded from the list and not the other way round[*] If the data is not highlighted, how will the data to excluded be recognized? if the data is not highlighted, it must appear in horizontal list.

    Sorry, reply as highlighted.

    Thank you

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Sorting from horizontal to vertical

    Hello mambo84,

    Will the data be arranged in tables exactly as you have shown?
    Will the tables start at "C2" and move to the right?
    Will there ever be tables below the ones you have shown?

  7. #7
    Registered User
    Join Date
    03-11-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Sorting from horizontal to vertical

    Hello Leith Ross

    will the data be arranged in tables exactly as you have shown?
    Not necessary, but prefer i can edit in further

    Will the tables start at "C2" and move to the right?
    Yes

    Will there ever be tables below the ones you have shown?
    No, i just need the header

    Thanks

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Sorting from horizontal to vertical

    Hello mambo84,

    Sorry for all the questions. The macro code depends on how the data is arranged.

    Are the tables in the workbook you posted the same as the tables in the original workbook?

  9. #9
    Registered User
    Join Date
    03-11-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Sorting from horizontal to vertical

    Hello Leith Ross

    Is alright. i'm glad when you help me.

    Yes, same as the original workbook. But the horizontal list should be in another sheet.

    regards

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Sorting from horizontal to vertical

    Hello mambo84,

    Okay, now I can start on coding the macro for you.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Sorting from horizontal to vertical

    Hello mambo84,

    Okay, here is the macro. It works as you specified on the posted workbook. There is button on "Sheet2" that runs the macro. The data is starts in cells "A2:C2". If rhe worksheet names in your workbook are different you will need to change them in the macro. They are marked in bold. The attached workbook has the macro and the button added.
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1