+ Reply to Thread
Results 1 to 4 of 4

Sort table based on criteria typed in the sheet

  1. #1
    Registered User
    Join Date
    03-25-2004
    Posts
    54

    Sort table based on criteria typed in the sheet

    Hey, guys. What's up?

    I'd like to know if it's possible to sort some data based on criteria randomly typed in cells.

    For example, I have a table with 5 columns. Above each column, I'll put the criteria for the sorting, typing numbers (for the order of the columns) and A or D (for Ascending or Descending).

    I've attached a file (with macro) for a better understanding. I hope you can help me with that.

    --- EDITED ---

    Actually, I just managed to get it working with my poor coding (new file attached). The problem is... For this attached example file, I created a table with 5 columns only; however my "real sheet" has 68 columns. I could duplicate the code 68 times, one for each column, but I am pretty sure there must be a more intelligent way to do it. So, please, could you help me create a smoother code? I would really appreciate it.

    Thanks in advance, guys. Cheers.

    brunces
    Attached Files Attached Files
    Last edited by brunces; 07-21-2016 at 07:46 PM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Sort table based on criteria typed in the sheet

    Maybe :

    Please Login or Register  to view this content.
    That's all folks.
    Last edited by karedog; 07-22-2016 at 01:02 AM.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    03-25-2004
    Posts
    54

    Re: Sort table based on criteria typed in the sheet

    Fantastic, karedog!

    I knew someone would come up with an intelligent "for/next" code. I need to learn how to use that.

    Thank you very much for your attention.

    brunces

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Sort table based on criteria typed in the sheet

    You are welcome brunces. Thanks for marking the thread as solved.


    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. Adjusted question - Copy data to 2nd sheet based on criteria and sort
    By ALWETTA in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-02-2015, 10:55 AM
  2. Replies: 0
    Last Post: 03-01-2015, 01:56 PM
  3. Replies: 1
    Last Post: 05-06-2014, 01:21 PM
  4. Copy and Paste Rows based on Criteria onto another sheet and sort based on oldest item
    By Kushal8684 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 05:37 AM
  5. Sort pivot table based on column selected in another sheet
    By holmes123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 05:42 PM
  6. How to create a click event to filter data based on typed criteria on another tab
    By CharterJP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2010, 12:52 PM
  7. Sort one excel sheet into two based on territory criteria
    By VBA? in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2010, 05:47 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