+ Reply to Thread
Results 1 to 5 of 5

VBA code to sort data in numerical order

  1. #1
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    VBA code to sort data in numerical order

    I need to sort a bunch of data in numerical order. Cells A6:A29 there a list of numbers related to B6:R29, cell A6 is related To B6:R6 and so on. I need a VBA code to sorts those rows in numerical order?

    Example:
    Example:

    A B C .... R
    1 CAR DOG HOUSE
    3 BIKE CAT DOOR
    9 GREEN BLACK ORANGE
    2 GIRAFE PURPLE TREE



    Result:

    A B C .... R

    1 CAR DOG HOUSE
    2 GIRAFE PURPLE TREE
    3 BIKE CAT DOOR
    9 GREEN BLACK ORANGE
    Last edited by Mr.Castle; 08-27-2019 at 02:16 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: VBA code to sort data in numerical order

    Why VBA? At any rate you should be able to get base syntax using Macro Recorder.

    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: VBA code to sort data in numerical order

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  4. #4
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: VBA code to sort data in numerical order

    Yes , the code worked

    Thank you Greg

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: VBA code to sort data in numerical order

    Hi again,

    Many thanks for your very prompt feedback.

    You're welcome - glad I was able to help.

    Regards,

    Greg M

+ 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 Numerical-With-Dash Values In Order
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-22-2015, 11:54 AM
  2. How can I data sort more than 1 row of numbers numerical order
    By Larbec in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2013, 12:46 AM
  3. Code for Button to Submit Data to List in Numerical and Chronological Order
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2012, 01:20 AM
  4. Sort Data Into Numerical Order..!
    By Scooby in forum Excel General
    Replies: 3
    Last Post: 07-05-2006, 08:30 AM
  5. [SOLVED] How do I sort in strict numerical order? i.e. 105 before 1049
    By mgr in forum Excel General
    Replies: 1
    Last Post: 06-14-2006, 12:25 PM
  6. [SOLVED] How do I sort multiple worksheet pages to list in numerical order?
    By Thanksforyourhelp in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-07-2006, 02:10 PM
  7. [SOLVED] sort worksheets in numerical order
    By andrew in forum Excel General
    Replies: 2
    Last Post: 02-07-2005, 05:19 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