+ Reply to Thread
Results 1 to 5 of 5

Copy ComboBox entry if typed in & if it doesnt aready exist in column

  1. #1
    Registered User
    Join Date
    09-30-2017
    Location
    london
    MS-Off Ver
    2010
    Posts
    1

    Copy ComboBox entry if typed in & if it doesnt aready exist in column

    Hi all, hope you can help me. I have created a transport request form for work, but trying to tidy it up a bit and make things better for any future requests.

    So basically, I have a userform which is now fully working and copies all the info into the relevant cells in "Sheet1".

    I have another sheet "Data" which contains all the data for the combo boxes on the userform. What I need is when someone types in the combo box and the info (in this case, delivery address) is not in the list already, then when clicking submit, as well as copying that info into the relevant field (which currently works), I also need it to copy it into the next blank row in column B in sheet "Data", so next time someone uses the form, that is now an option in the combo box.

    It doesn't necessarily need to do this when submitting the userform as I have another button on the sheet that saves the form as a PDF, so I could add it to this code if it makes any difference?

    Hope this makes sense.

    Thanks in advance.

  2. #2
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Copy ComboBox entry if typed in & if it doesnt aready exist in column

    Chiggerz,

    There is no need to maintain your data sheet to populate the combobox. Unique values for the delivery address combobox can be loaded right from sheet 1. Add the following code to your userform's Activate event routine while removing any other code you already have in place to load the combobox. Change the col=4 to the column that holds the delivery address on sheet 1. Change the name of the combobox to your combobox name on the line with the "With" statement.

    When the code runs, it will cycle down the column of the delivery address and additem only the unique values.

    Please Login or Register  to view this content.
    HTH,
    Maud

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Copy ComboBox entry if typed in & if it doesnt aready exist in column

    Maudibe,
    I think you might need to add
    Please Login or Register  to view this content.
    to your code? I had to when I tried to use it.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Copy ComboBox entry if typed in & if it doesnt aready exist in column

    If you are using Option Explicit in your code then yes you will have to declare it.

  5. #5
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Copy ComboBox entry if typed in & if it doesnt aready exist in column

    I kind of thought that but wasn't sure. I haven't quite figured out everything that must be declared when using Option Explicit......other than everything?

+ 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. How to add a value to the last blank cell of a column if it doesnt exist there already.
    By yoursamrit2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2015, 04:42 AM
  2. Macro to Replace Row if Exists or copy to new row if doesnt exist
    By jgibs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2012, 01:23 PM
  3. [SOLVED] Find Value in all worksheets, if doesnt exist then...
    By bg_enigma1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2012, 12:30 PM
  4. If named range doesnt exist next k
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2012, 12:17 AM
  5. Delete row if value(array) doesnt exist in column
    By wobaby in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2009, 02:34 AM
  6. find number that doesnt exist among others.
    By TheBean in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2006, 09:28 AM
  7. Data entry - Copy contents of cell typed in one cell to another ce
    By danie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-16-2006, 02:55 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