+ Reply to Thread
Results 1 to 2 of 2

Macro code for auto-sorting of a selected range

  1. #1
    Registered User
    Join Date
    12-02-2010
    Location
    Singapore, Singapore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Macro code for auto-sorting of a selected range

    I am currently running into this problem.

    Under this simplified Excel spreadsheet, I have with me classification of continents and the respective countries under it.

    I have created a UserForm button which allows me to just add in additional country by typing in the country's name and then selecting the continent it belong to.

    Upon completion, the macro will create a new row under the continent it belongs to and then add in that new country. (You can try running the macro by clicking on that button)

    However, my problem now is that once the new country has been added in, I want the macro to continue to select all the rows which have the same continent (inclusive of that new entry) and then auto-sort it into alphabetical order (only for that continent).

    For instance, according to what the spreadsheet and what my current macro will do, when a new coutnry (Eg China) is added, it will appear below Korea. So the order goes by Japan, Korea then China.

    What I want is for the macro to continue doing the auto-sort, so that under Asia, it will be China, Japan then Korea.

    Is it possible to do as such?

    Please help!

    Many thanks!

  2. #2
    Registered User
    Join Date
    12-02-2010
    Location
    Singapore, Singapore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Macro code for auto-sorting of a selected range

    please refer to the attachment for what I have mentioned earlier.

    Thanks!
    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