+ Reply to Thread
Results 1 to 7 of 7

sorting from previous column (VBA, Excel) in decreasing and increasing order

  1. #1
    Registered User
    Join Date
    02-13-2012
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    39

    sorting from previous column (VBA, Excel) in decreasing and increasing order

    Hello,

    I'm trying to sort data in decreasing order from column A in column B using VBA (Excel), so starting with Max value.
    With the code below, no data is written in column B?

    Please Login or Register  to view this content.
    In column C, I will want to write the data of column A in increasing order, so starting with Min value?
    Thank you for your advice!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: sorting from previous column (VBA, Excel) in decreasing and increasing order

    zeno1,

    Does this have to be a macro?
    For descending, in Cell B3 and copied down:
    Please Login or Register  to view this content.
    For ascending, in cell C3 and copied down:
    Please Login or Register  to view this content.

    The above formulas assume your data is numeric. If it has to be a macro, let me know.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    02-13-2012
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: sorting from previous column (VBA, Excel) in decreasing and increasing order

    tigeravatar,
    Thank you for your suggestion, however I'm indeed writing this in a vba macro.
    Cheers

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: sorting from previous column (VBA, Excel) in decreasing and increasing order

    zeno1,

    Here's macro code that accomplishes what you're looking for:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-13-2012
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: sorting from previous column (VBA, Excel) in decreasing and increasing order

    Thank you tigeravatar, this works!

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: sorting from previous column (VBA, Excel) in decreasing and increasing order

    You're very welcome, and thank you for the rep

  7. #7
    Registered User
    Join Date
    02-13-2012
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: sorting from previous column (VBA, Excel) in decreasing and increasing order

    Thank you tigeravatar, this works!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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