+ Reply to Thread
Results 1 to 3 of 3

Different SORT based on data entry

  1. #1
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Different SORT based on data entry

    I have a macro in a workbook that looks like this:
    Please Login or Register  to view this content.
    I want to amend that code so that the SORT performed in the macro is only performed when data is entered into a particular cell.

    Until that point...I want the SORT to sort by Range("AG7"), and then by Range("C7)...excluding Range("AH7") from the sort.

    For example:

    Say cell A1 is empty.
    I want the macro to sort by Range("AG7") descending, and then by Range("C7") ascending...until data is entered into cell A1.

    After data is entered into cell A1, I want the macro to include Range("AH7") in the sort.

    So, basically, I need the macro to look in cell A1 and see if it's blank before sorting, to determine which sortation to perform.
    Last edited by HuskerBronco; 12-27-2008 at 05:49 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello HuskerBronco,

    This macro checks cell "A1" and decides which sort to perform.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167
    Thanks Leith,

    I pasted your code over my original macro, and made minor adjustments to conform to my spreadsheet.
    I triggered the macro and got a number of Run time '424' error messages and a syntax error.

    I resolved all of them by making minor adjustments to your code.
    My finished code looks like this:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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