+ Reply to Thread
Results 1 to 8 of 8

Decreasing validation list

Hybrid View

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Decreasing validation list

    Hello
    I want to make the validation list decreasing as soon as selecting item from the list
    Say I have MyList named range with some values such as Yasser1 , Yasser2 and so on
    I want simply when selecting Yasser1 not to appear again in the list
    Here's an attachment
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Decreasing validation list

    Look at this link. While it is about table seating at a party, it employs the feature you are looking for.

    http://blog.contextures.com/archives...ng-with-excel/
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Decreasing validation list

    Thanks for the quick reply
    I want to solve this problem by vba not formulas

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Decreasing validation list

    Is there a way for doing that task by code?

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Decreasing validation list

    No reply till now. Is this kind of thread new or difficult?
    I found a code but I don't like it as it removes the original list ...!!

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Decreasing validation list

    I googled "vba listbox delete selected item" and found several items of interest.

    Here is the first one to look at:

    http://www.ozgrid.com/forum/showthread.php?t=27094

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Decreasing validation list

    I mean Validation list not listbox ..
    This is the code I found but it removes the original list
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim strVal As String
    
    Dim strEntry As String
    
    
    
        On Error Resume Next
    
            strVal = Target.Validation.Formula1
    
                If Not strVal = vbNullString Then
    
                    strEntry = Target
    
                    Application.EnableEvents = False
    
                    With Sheet1.Range("MyList")
    
                        .Replace What:=strEntry, Replacement:="", _
                          LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False
    
                        .Sort Key1:=.Range("A1"), Order1:=xlAscending, Header:=xlNo, _
                          OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    
                        .Range("A1", .Range("A65536").End(xlUp)).Name = "MyList"
    
                    End With
    
                End If
    
            Application.EnableEvents = True
    
        On Error GoTo 0
    
    End Sub
    As an idea but I can't figure it out .. store my original list and deal with the stored array not with th origninal list!!

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Decreasing validation list

    Thanks everybody
    I found the solution at this link
    http://www.ozgrid.com/forum/showthread.php?t=192696
    thanks a lot

+ 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. Replies: 0
    Last Post: 01-09-2013, 11:44 AM
  2. [SOLVED] Reset dependant validation list when the previous validation list is changed.
    By Rimmu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2012, 09:23 AM
  3. Replies: 3
    Last Post: 07-20-2012, 09:52 AM
  4. Finding a decreasing value from a list of increasing numbers
    By Polaris11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-05-2011, 06:13 PM
  5. increasing/decreasing; decreasing rate - problem
    By vasyuta in forum Excel General
    Replies: 0
    Last Post: 08-23-2006, 05:26 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