+ Reply to Thread
Results 1 to 7 of 7

Modyifying code or new to delete duplicate items in others comboboxes based on combobox

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-24-2021
    Location
    Palestine
    MS-Off Ver
    2019
    Posts
    312

    Modyifying code or new to delete duplicate items in others comboboxes based on combobox

    Hello
    I want adjusting this jindon's code or new whatever . what I look for when I select the item from first combobox then shouldn't show the the same item in the others comboboxes , for instance if I select item ATR-100 from combobox1 then should not show in others comboboxes and and if I select item ATR-101 from combobox2 then should not show in comboboxes 1,3,4 . so when select the item from specific combobox shouldn't show in the others comboboxes .
    thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Modyifying code or new to delete duplicate items in others comboboxes based on comb

    Hello.
    Please see if this works for you:

    PHP Code: 
    Private Sub GetMatch(cb As MSForms.ComboBox)
    Dim N$
    D2.RemoveAll
    For Each cbTmp In D1.Keys
      D2
    (cbTmp) = D1(cbTmp)
    Next
    For Each cbTmp In myCB
      
    If cbTmp <> "" Then D2.Remove cbTmp.Value
    Next
    For Each cbTmp In myCB
      cbTmp
    .Column Application.Transpose(D2.Items)
      If 
    cbTmp.Value <> "" Then
        cbTmp
    .AddItem D1(cbTmp.Value)(0), 0cbTmp.List(01) = D1(cbTmp.Value)(1)
      
    End If
    Next
    With cb
      N 
    Right(cb.Name1)
      If .
    ListIndex > -1 Then
        Controls
    ("TextBox" N) = .List(.ListIndex1)
      Else
        
    Controls("TextBox" N) = ""
      
    End If
    End With
    End Sub 
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    05-24-2021
    Location
    Palestine
    MS-Off Ver
    2019
    Posts
    312

    Re: Modyifying code or new to delete duplicate items in others comboboxes based on comb

    great ! this is what I look for but I face error application defined or object deifined error when right item in combobox instead of selection in this line
    D2.Remove cbTmp.Value
    if it's possible when right wrong item then should show message "is not matched"
    thanks again

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Modyifying code or new to delete duplicate items in others comboboxes based on comb

    Quote Originally Posted by Alaa-A View Post
    great ! this is what I look for but I face error application defined or object deifined error when right item in combobox instead of selection in this line
    D2.Remove cbTmp.Value
    So let's prevent this from happening:
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-24-2021
    Location
    Palestine
    MS-Off Ver
    2019
    Posts
    312

    Re: Modyifying code or new to delete duplicate items in others comboboxes based on comb

    all of things are ok !
    can you tell me what's the procedure you added to avoid error?
    actually I don't note it .

  6. #6
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Modyifying code or new to delete duplicate items in others comboboxes based on comb

    Don't forget to add reputation to the answer that helped you.

  7. #7
    Forum Contributor
    Join Date
    05-24-2021
    Location
    Palestine
    MS-Off Ver
    2019
    Posts
    312

    Re: Modyifying code or new to delete duplicate items in others comboboxes based on comb

    Don't forget to add reputation to the answer that helped you.
    actually I really did it , but as you know , not always allow so . this time I can't sorry !
    even if that thanks so much for your help

+ 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] modified code merge duplicate items for each sheet separately based on this thread
    By KalilMe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-16-2021, 12:30 AM
  2. [SOLVED] match and update brands from comboboxes with columns based on selection combobox
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-15-2021, 08:27 AM
  3. [SOLVED] VBA code delete rows based on duplicate >255 charachters
    By Sirilias in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-11-2018, 04:12 PM
  4. combobox to filter based on two previous comboboxes
    By zak.horrocks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2014, 11:34 AM
  5. How to remove duplicate items from the Combobox
    By kerznerk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2014, 01:26 AM
  6. VBA code to find and delete cell contents based on userform combobox selections
    By anfdrew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2013, 04:13 PM
  7. i want to delete duplicate items in a list using code.
    By ndm berry in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2005, 10:05 AM

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