+ Reply to Thread
Results 1 to 3 of 3

VBA To Sort 2 Columns Automatically

  1. #1
    Registered User
    Join Date
    09-09-2014
    Location
    Atlanta, GA
    MS-Off Ver
    2013
    Posts
    2

    VBA To Sort 2 Columns Automatically

    Good afternoon,

    Please forgive my ignorance as I have limited VBA exposure.
    I found a sample VBA online and have been able to modify it to meet part of my requirements but I cannot seem to get it to update both columns.
    I want the macro to sort column B then column A ascending every time there is an update in column D.
    Please note that my columns have headers and the true data starts in cells A2:D2.

    The following is what I have so far and I would appreciate assistance in having this code automatically sort column B first.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: VBA To Sort 2 Columns Automatically

    See if this works,

    Please Login or Register  to view this content.
    Notice that it will sort in ascending order by default, and .item(1) = A1 and .item(2) = B1 provided that the data structure works with using currentregion within VBA.

    Cheers,
    berlan

  3. #3
    Registered User
    Join Date
    09-09-2014
    Location
    Atlanta, GA
    MS-Off Ver
    2013
    Posts
    2

    Re: VBA To Sort 2 Columns Automatically

    Wow,

    Thank you so much!!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sort by multiple columns with sort criteria cell dependent
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-24-2014, 02:22 AM
  2. Replies: 2
    Last Post: 01-15-2014, 09:31 AM
  3. [SOLVED] How to automatically sort the columns (move the columns around)
    By OldGrantonian in forum Excel General
    Replies: 4
    Last Post: 08-18-2013, 07:44 AM
  4. Replies: 5
    Last Post: 04-25-2013, 11:50 PM
  5. [SOLVED] Automatically Sort Columns
    By HeatherV in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-12-2012, 04:33 PM
  6. Sort Button that does not sort Balance Columns
    By hasancem in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2012, 10:31 AM
  7. Automatically sort new data by multiple columns
    By burtonlang in forum Excel General
    Replies: 3
    Last Post: 10-26-2009, 08:03 AM
  8. data sort is not including all columns in sort
    By Tracy in forum Excel General
    Replies: 1
    Last Post: 10-03-2005, 08:05 PM

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