+ Reply to Thread
Results 1 to 9 of 9

Auto Sort Macro Based on Two Columns

  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    Miami Beach, Florida
    MS-Off Ver
    Office 2010 x64
    Posts
    9

    Unhappy Auto Sort Macro Based on Two Columns

    Hear me out. I spent the better part of my day trying to figure out how to get the all the different variations of the possible solution in question. On this site and others. My brain is basically mush at this point. For some reason I can not get the macro to work on it's own. I would tell you which macro I used but it must have been close to 10 different kinds. The only one I was able to get working, you needed to hit play in order to get it to sort.

    Basically I was looking to have the data in tab "programmer 01" column K automatically sort based on its value as soon as a value is entered in column J. Column J is the input for a vlookup in column K. After it sorts on K I need it to then sort on column A. And of course the the hope is I can get this sort as soon as a value is entered in J.

    I've attached a sample of the sheet. Hope someone can help me because I'm stumped atm.
    Attached Files Attached Files
    Last edited by Zabalba; 08-22-2012 at 12:05 PM. Reason: I broke the rules. Mod yelled at me. Sorry.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,671

    Re: I know... another auto sort thread.

    Title changed as requested.
    Last edited by protonLeah; 08-15-2012 at 04:28 PM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    04-13-2012
    Location
    Miami Beach, Florida
    MS-Off Ver
    Office 2010 x64
    Posts
    9

    Re: I know... another auto sort thread.

    Thread title was updated. Apologies for not reading the rules. Did I at least post this in the right section?

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,671

    Re: Auto Sort Macro Based on Two Columns

    Why do you have the worksheet change event in a standard module instead of the sheet module where it belongs?

  5. #5
    Registered User
    Join Date
    04-13-2012
    Location
    Miami Beach, Florida
    MS-Off Ver
    Office 2010 x64
    Posts
    9

    Re: Auto Sort Macro Based on Two Columns

    Quote Originally Posted by protonLeah View Post
    Why do you have the worksheet change event in a standard module instead of the sheet module where it belongs?
    When I was attempting to get the macro to work I would right click on the tab and view code. That is where I was placing the code. Is this the incorrect place?

  6. #6
    Registered User
    Join Date
    04-13-2012
    Location
    Miami Beach, Florida
    MS-Off Ver
    Office 2010 x64
    Posts
    9

    Re: Auto Sort Macro Based on Two Columns

    small bump

  7. #7
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Auto Sort Macro Based on Two Columns

    Event macros, which are automatically triggered when an event happens, have to go on the standard module which refers to the object where the event is supposed to happen. Your event macro is a worksheet change one, so it needs to be placed on the worksheet module it refers to, meaning when you open to view code you need to paste it on "Sheet2 (PROGRAMMER_01)" (double click on that on the left menu).
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  8. #8
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Auto Sort Macro Based on Two Columns

    You can see how on here.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-13-2012
    Location
    Miami Beach, Florida
    MS-Off Ver
    Office 2010 x64
    Posts
    9

    Re: Auto Sort Macro Based on Two Columns

    Quote Originally Posted by Pichingualas View Post
    You can see how on here.
    Thank you protonLeah, and Pichingualas for your replies. I have not had a chance to come back to this project since I was swamped with my normal duties. I moved the code into the specific sheets and the automatic sorting works like a charm. I just picked up Excel VBA for Dummies. I hope I learn much more from that and give back to the forum as you guys did.

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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