Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Values to Combobox Source

    I have a row, "AG" on a sheet, "Results" which contains a list of contacts for a database.

    What I want, is if the data the user enters into the combo box is not within the list of options, then the data they entered is recorded onto another sheet, "retain"

    Any ideas?

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Values to Combobox Source

    What is this combo box, and where is it? Is it on a spreadsheet or in a user form? What are the contacts? Strings? Do they have to match exactly, including case? What is the source of the combo box data, the list in row AG? How many items in row AG, or how do I know how many to search? Any empty cells in the list? Where on sheet retain do you want it stored?
    Legare Coleman

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Values to Combobox Source

    The combobox is on a userform. The contacts are just text in cells, ranging from row 1 of column AG to row 865 or so. They are all in proper case format, (I can stress to my users the importance of proper case format..) Yes, the source is column AG, There are no empty cells except for at the end of the column. these values can be stored anywhere on sheet retain. The sheet will then be exported automatically to a 'technical review' spreadsheet which will give me guidelines to add the new entries to the end of the list, and alphebetize the column..

    Hope that makes sense!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Values to Combobox Source

    The following was not tested:

    <pre>Dim I As Integer
    Dim strContact As String
    Dim bInList As Boolean
    strContact = UCase(MyForm.cbContact.Text)
    If strContact <> "" Then
    I = 0
    bInList = False
    Do While Worksheets("Results").Range("AG1").Offset(I, 0).Value <> ""
    If UCase(Worksheets("Results").Range("AG1").Offset(I, 0).Value) = strContact Then
    bInList = True
    Exit Do
    End If
    I = I + 1
    Loop
    If Not bInList Then
    Worksheets("Retain").Range("A1").Value = strContact
    End If
    End If
    </pre>

    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •