+ Reply to Thread
Results 1 to 5 of 5

Sort range if cells change

  1. #1
    Registered User
    Join Date
    09-14-2007
    Posts
    6

    Sort range if cells change

    Is it possible to have a macro which automatically sorts a range of cells if any value in that range changes?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See link. Look for
    Update Validation List
    http://www.contextures.com/excelfiles.html#DataVal

    or this event macro. Right click the sheet then select view code and paste in the below

    It will sort on Col A

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    09-14-2007
    Posts
    6
    Thanks for that.

    I have discovered a problem though.

    The validation list is populated from values in another worksheet, and therefore the list contains formulas with cell references in.

    When the value in the other worksheet changes, and the value is entered into the validation list the macro does not run.

    Is there any way round this?

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Worksheet_Change macro is triggered only if a cells contents are changed. This does not occur in cells with formulas

    Try using a Worksheet_Calculate() macro
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Registered User
    Join Date
    09-14-2007
    Posts
    6
    If anyone could explain how this could be done with a worksheet_calculate macro I would be very grateful.

    Cheers

+ 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