+ Reply to Thread
Results 1 to 6 of 6

Help with VBA to look up data from user form and alter or add new if necessary.

  1. #1
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Help with VBA to look up data from user form and alter or add new if necessary.

    Hi there.

    On the attached workbook there is a sheet named 'Wet Waste Record' which contains a userform.

    Currently the userform looks up the item in combobox1 and adds the value in textbox1 to column b.

    I want to if possible allow the userfrom to make a new entry on the spreadsheet if the item does not already exist in the named range WetStockRecord. In the next blank row and paste Combobox1 value in column A and Textbox1 value in column B.

    For example on the attached sheet the userform works perfectly on the item d Kronenbourg how ever if I wish to add a record for d Fullers London Pride I cannot at current as programming not correct.


    Hope this makes sense and someone can assist.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Help with VBA to look up data from user form and alter or add new if necessary.

    There's a load of posts similar to this on the forum. Search the forum first, there may be a solution applicable.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Help with VBA to look up data from user form and alter or add new if necessary.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with VBA to look up data from user form and alter or add new if necessary.

    Hi mezza89

    Try this for the Command Button Code
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Help with VBA to look up data from user form and alter or add new if necessary.

    Thank you AlphaFrog and jaslake.

    Both codes work perfectly thank you.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with VBA to look up data from user form and alter or add new if necessary.

    Hi mezza89

    You're welcome...glad I could help.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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. User form to post data and charts according to user defined selections
    By siroco79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2013, 11:16 AM
  2. Replies: 1
    Last Post: 08-28-2013, 05:04 PM
  3. [SOLVED] User forms - choosing location of your data to be shown in your user form
    By jasonbwt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2012, 08:48 AM
  4. User Form to check data before closing form
    By CityMPLSEmpolyee in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-15-2012, 12:42 PM
  5. Transfer User form data to a worksheet w.r.t. combobox item on the form
    By nm766 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2011, 12:43 PM

Tags for this Thread

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