+ Reply to Thread
Results 1 to 3 of 3

VBA Data Sort

  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    VBA Data Sort

    Hi, I wonder whether someone may be able to help me please.

    I'm using the snippet of code below to perform a series of actions on a given array.

    Please Login or Register  to view this content.
    I'm now trying to sort, in the case of the above, columns B:F ascending via column B.

    I've done quite a bit of searching and in all honesty the examples on line have made me more confused than when I started.

    I just wondered whether someone may be able to look at this please and offers some guidance on how I can add the 'Data Sort' function.

    Many thanks and kind regards

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA Data Sort

    Don't forget that there is the "Record Macro" feature which could have fairly easily given you the answer. That is what I did to show you what it looks like:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Data Sort

    Hi @stnkynts, thank you very much for taking the time to reply to my post and for the solution and advice.

    Initially, I couldn't get your code to work, simply down to changes I had to make to cater for the header row. So I tried your suggestion and recorded the macro and it now works perfectly, thank you!

    My main area of confusion was how to incorporate the 'LastRow' range with the data sort, but as I said your solution works great.

    Many thanks and kind regards

+ 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] How to sort the data by item code first, then sort them by date?
    By Zecond in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-04-2013, 01:55 AM
  2. Replies: 4
    Last Post: 11-20-2012, 06:00 PM
  3. [SOLVED] Pls. reply Sort Data and copy to next coulmn when sort order chang
    By shital shah in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2005, 10:05 AM
  4. Sort Data and copy to next coulmn when sort data changes
    By shital shah in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2005, 10:05 AM
  5. Sort Data and copy to next coulmn when sort data changes
    By shital shah in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2005, 02:05 AM

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