• Amending list in Data Validation List (2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Amending list in Data Validation List (2000)

    • This topic has 7 replies, 3 voices, and was last updated 19 years ago.
    Author
    Topic
    #431949

    Is there a quick way to add a new entry to a List box without keep having to search for those cells listed in the Validation List.
    see screenshot.

    Viewing 0 reply threads
    Author
    Replies
    • #1012185

      Instead of a validation list, you could use a combobox and have code to add a new entry to the list

      Steve

      • #1012189

        Thats great thanks for that.

      • #1012206

        If this is the case, would you not need to create a combo box for every single line in the list??
        That might be a tedious task!!

        • #1012217

          No you would not have to (though you could if you wanted to evilgrin.

          You could create just one and have it move as needed via a selection change event. post 537,206 has a simple example of the idea. validation, code to add to the list would have to be added.

          Steve

          • #1012295

            This is great….very nice tip!

            I was experimenting with it and came across a minor glitch. I noticed that if you select a range of white cells and include just one (or more) of the yellow cells, the combo activates in that white cell. Is there a way to fix this? Its a great example for me, as I am still learning to get to grips with the intersect function!

            Tx

            • #1012328

              How about this?

              Option Explicit
              Private Sub Worksheet_SelectionChange(ByVal Target As Range)
                  Dim cbo As ComboBox
                  Dim rCell As Range
                  Set cbo = Me.myComboBox
                  Set rCell = Intersect(Target, Range("A1:A10"))
                  If Not rCell Is Nothing Then
                      If rCell.Count = 1 Then
                        With cbo
                            .Visible = True
                            .LinkedCell = rCell.Address
                            .ListFillRange = Me.Range("C1:C8").Address
                            .Left = rCell.Left
                            .Top = rCell.Top
                            .Width = rCell.Width
                            .Height = rCell.Height
                        End With
                      End If
                  Else
                      cbo.Visible = False
                  End If
                  Set rCell = Nothing
              End Sub

              This will first check for the intercept then test for the number of cells selected.

              Steve

            • #1012365

              Cool! thumbup

    Viewing 0 reply threads
    Reply To: Reply #1012365 in Amending list in Data Validation List (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel