+ Reply to Thread
Results 1 to 2 of 2

Specific sorting macro for 2 columns

  1. #1
    Registered User
    Join Date
    04-21-2016
    Location
    aasd
    MS-Off Ver
    2013
    Posts
    6

    Specific sorting macro for 2 columns

    Hi, I need help on sorting 2 columns and as there are many thousand rows doing it manually doesn't cut it. As it is kinda difficult to describe I will just provide an example.
    Suppose we have columns A and B with values as provided. I need to sort these two columns so that it would look like it can be seen from 9th to 14th row. Any help will be appreciated!

    excel_example.PNG

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Specific sorting macro for 2 columns

    If there is no adjacent data then:

    Please Login or Register  to view this content.
    And, welcome to the Forum!

    If you haven't used macros before you'll need to go to:
    File- options - trust center -trust center settings - macro settings ,
    the second option down (disable all macros with notification)

    Then - Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    *Be sure to save the book with the code as Macro-Enabled
    Last edited by xladept; 04-21-2016 at 12:19 PM. Reason: Welcome and directions
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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] macro to copy specific columns and rows for a specific month and week
    By Shellybelly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2015, 11:23 AM
  2. Replies: 8
    Last Post: 04-04-2013, 08:02 PM
  3. Sorting Columns by Specific Values
    By Tony Morgan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2012, 09:43 AM
  4. [SOLVED] Exporting specific data columns from sheet and sorting by string
    By ardais in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-04-2012, 12:43 AM
  5. Macro to copy specific data to specific columns from a pivot table
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2012, 07:24 PM
  6. Sorting data from one general column to multiple specific columns
    By abuchan in forum Excel Programming / VBA / Macros
    Replies: 37
    Last Post: 04-02-2011, 04:15 AM
  7. Sorting a specific group of columns by a member of that Column
    By 00Able in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2011, 09:22 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