+ Reply to Thread
Results 1 to 4 of 4

VBA Macro sorting

  1. #1
    Registered User
    Join Date
    08-20-2009
    Location
    Kerry, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    17

    VBA Macro sorting

    Hi,

    Here is my question.
    I have information from column A to column F.

    I have this macro to sort column A, with the selection expanded.

    Please Login or Register  to view this content.
    I now want to sort column B but I also want this to be dynamic, i.e. the total information in the worksheet may change. It's all filled in with formulas from another sheet.

    Example
    Col A Col B
    AED KWD
    BCD XCD
    AED USD
    EUR ZAR
    AED EUR

    So after sorting column A with the selection expanded I get this.

    Col A Col B
    AED KWD
    AED USD
    AED EUR
    BCD XCD
    EUR ZAR

    Now I want to sort column B according to the items in column A like so

    Col A Col B
    AED EUR
    AED KWD
    AED USD
    BCD XCD
    EUR ZAR

    Any idea if this is possible?
    Last edited by sflemings; 08-31-2009 at 09:01 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA Macro sorting

    Hi sflemings. Be sure to read through the Forum Rules so you can use and follow them effectively. For instance, you'll need to edit that post above and put code tags around that code you used. (Like I did below...)

    In Excel 2003 you can filter by up to three "Keys" all at once). Also, you do not have to "select" a range to do something to it.
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-20-2009
    Location
    Kerry, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: VBA Macro sorting

    Perfect. Thanks for that.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA Macro sorting

    Glad to help. (and thanks for updating post #1)

    =====
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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