+ Reply to Thread
Results 1 to 11 of 11

Sorted Data Validation List on Another Sheet code very wordy.

  1. #1
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Question Sorted Data Validation List on Another Sheet code very wordy.

    Hello!

    I have a clunky code which takes the value in cell C5 on SHEETB and uses it for a dropdown validation list from a named range on SHEETA.
    If the C5 value is not on the dropdown, it asks you if you want to add it, so the next time you use that worksheet, you won't have to re-type that new value.

    So as new values get added, the dropdown list grows and it does a sort so that the list is always in alphabetical order.

    I'd appreciate it if someone can look at this code. I used the macro recorder alot, and this result works but it seems to me like some of the steps can be combined. And then I set the range to 10,000 entries so I'm not sure what's going to happen if there's 10,001 (will that one not get sorted?), etc.

    Regards,
    Leaning




    Please Login or Register  to view this content.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    I would do it differently, but obviously the choice is yours.
    In data validation I would have this.
    Source:
    =SHEETA!$D:$D

    Then I would have the following code:
    Please Login or Register  to view this content.
    Last edited by skywriter; 01-26-2016 at 10:32 PM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    Skywriter: That's awesome! It works tons different and smoother without the screen flickering all over the place from changing sheets.
    I appreciate your help. I think you chopped almost half the lines of code, so yeah, it needed some work. Mad props!

    Regards,
    Leaning

  4. #4
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    Skywriter,

    I took the example workbook you fixed and tried to apply it to the actual workbook. It works great, but the dropdown in the cell has a bunch of extra white space in it that I can't tell where it's coming from. Any ideas? All PWs are "help", BTW.
    Regards,
    Leaning
    Attached Files Attached Files
    Last edited by leaning; 01-27-2016 at 12:06 AM.

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    Your project is locked, I can't see the code.

  6. #6
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    skywriter: the protect, unprotect, and VBA passwords are all "help". My actual project is locked so I wanted to see if maybe the lock was causing problems and creating that white space.

    HTH.
    Regards,
    Leaning

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    Your location is spelled wrong, you are in Michigan?

    If you are happy with my help a bump of the reputation button would be appreciated.
    Please Login or Register  to view this content.
    Last edited by skywriter; 01-27-2016 at 01:36 AM.

  8. #8
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Question Re: Sorted Data Validation List on Another Sheet code very wordy.

    skywriter: still not working on my end. Dropdown still has extra spaces. Any other ideas? I highlighted all the data cells purple, but it doesn't look like there is anything below that is making the dropdown list so long. I'm stumped. Thanks for sticking with me through this. And I updated my location. Thanks for that!

    Regards,
    Leaning
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Question Re: Sorted Data Validation List on Another Sheet code very wordy.

    Duplicate post
    Last edited by leaning; 01-27-2016 at 10:20 AM.

  10. #10
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    I kept getting blank lines in the dropdown using skywriter's code, so I'm back to my clunky code:

    Please Login or Register  to view this content.
    If anyone has any ideas on making this better and less flickering, I'd appreciate it.

    Regards,
    Leaning

  11. #11
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Sorted Data Validation List on Another Sheet code very wordy.

    This is better:

    Please Login or Register  to view this content.
    Last edited by leaning; 01-28-2016 at 11:02 PM.

+ 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] Sorted and unique validation list
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-23-2016, 05:20 PM
  2. [SOLVED] Extract a non-sorted list with blank cells into a sorted list
    By RJK in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-08-2015, 12:41 AM
  3. Sorted data in drop list (data validation)
    By ONB in forum Excel General
    Replies: 4
    Last Post: 08-30-2012, 07:22 AM
  4. Replies: 11
    Last Post: 10-06-2011, 02:26 PM
  5. Replies: 7
    Last Post: 11-11-2010, 09:51 PM
  6. Range is only one cell. Less wordy code?
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2010, 08:00 AM
  7. Need sorted validation list
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-23-2005, 02:05 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