+ Reply to Thread
Results 1 to 6 of 6

User form for input in list

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague
    MS-Off Ver
    Excel 2013
    Posts
    161

    User form for input in list

    Hi all,

    I need help with a complicated macro for input data in a list. Maybe is not so complicated, but first time I’m doing this type of macros, and I’m stuck in place.

    Currently I have list in which the data are inputted directly. Instead inputting the data this way, I need when the button “Fill new data“ is pressed, template to appear in which the below described data will be filled.
    After all data is filled, with pressing of the button “Submit data”, the data from the template to be populated in the first free row in the file.
    In case some data is not filled, a popup box to appear asking the given data to be filled.

    The required data are:

    Product code – Is selected in cell B3 (from list “Product_code”). After pressing the button “Fill new data”, the content of cell B3 is copied in the selected cell in column A.
    Input code – This value is the next available number of the product which is selected in cell B3 (the formula is “COUNTIFS (A9:A24, B3) +1”). After pressing the button “Fill new data”, the content of cell C3 is copied in the selected cell in column B.
    Data #1 – This value is coming from preretirement list (the values are Yes and No)
    Data #2 – This value is coming from preretirement list from sheet “Pickup_list “(the values are Yes and No)
    Data #3 – This value is coming from preretirement list from sheet “Pickup_list “
    Date from – start date, with preretirement format (dd mmm yyyy)
    Date to – start date, with preretirement format (dd mmm yyyy)
    Comment – free text filled by the person who is populating the data

    The person who is inputting the data should fill all cells in the form except the “Input code” cell. This should be automatic calculation.

    In the attached file is the draft file I’ve prepared.


    Thank you in advance for your help.

    Igor

    Macro test file.xlsb

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

    Re: User form for input in list

    I have made a few changes to what you had. Take a look and see if I am on the right track for what you want. The data does not get transferred to the sheet yet as I wanted to see if I was doing what you wanted so far.
    igormigor-user-form-for-input-in-list-macro-test-file.xlsb
    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

  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: User form for input in list

    Removed this post because the code I provided was flawed. I have corrected it and posted the new workbook with the updated code in the next post.
    Last edited by gmr4evr1; 09-15-2015 at 02:59 PM. Reason: Flawed code

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

    Re: User form for input in list

    Igor,
    I noticed some flaws with the code in my last post. I have modified it and believe that I have it figured out now. A message will popup if one of the fields is blank, then the cursor will move to the blank field, then the code will stop to allow the user to fill in the missing field.
    I hope this is to your liking...

    igormigor-user-form-for-input-in-list-macro-test-file V3.xlsb

  5. #5
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague
    MS-Off Ver
    Excel 2013
    Posts
    161

    Re: User form for input in list

    Gmr4ever1 that great!!!!!!! Thank you for your help on this.
    Its definitely in the direction I wanted to go.

    I just have several comments for adjustment.

    For the "Product code", is it possible to be able to be chosen the product code from the sheet (in cell B2), but also to be able to choose the product code from the UserFomr.

    The "Input code" should be the formula "COUNTIFS (A9:A24, B3) +1". It counts how many products from certain type are there in the file, and it generates the next available number. It will be great if the next available number is visible in the formula in cell C1, but the next available number calculation to be based on formula included in the macro.

    And at the end, after I submit the data, the UserForm to be closed automatically.

    Thank you.
    Igor

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

    Re: User form for input in list

    Igor, I believe I have addressed the comments you had. Please see attached and look the revised form over and test it to verify that it is correct. I changed a couple of additional items as well.

    1) The formula you were using
    Please Login or Register  to view this content.
    was counting the numbers and adding 1 to it which was actually causing it to be 1 higher than it should have been. Example, if there was 1 Product 1 and you added another, the formula would show 3 product 1 instead of 2.

    2) I changed the tab order so that the user could start at the top of the form and then tab down through the rest of the form. I find this makes it easier on the user.

    user-form-for-input-in-list-igormigor-user-form-for-input-in-list-macro-test-file-v4.xlsb

    Please let me know if there are any other changes that need to be done...or if I have changed something I shouldn't' have.

+ 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. Data Input Form with number of line items based on user input
    By j_gideon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2013, 02:54 PM
  2. vba excel user form restrict input on user textbox
    By samz93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 04:38 PM
  3. User Input form help
    By jawwad321 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-03-2013, 02:39 PM
  4. User Input form into formula
    By neato in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-27-2012, 01:54 PM
  5. [SOLVED] Input user form in vb
    By sipcine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-18-2012, 10:22 PM
  6. User Input Form
    By kumaramitoujjain in forum Excel General
    Replies: 2
    Last Post: 09-09-2010, 01:48 AM
  7. add list user form, list box and get input
    By rajaneeshjandhyam in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-18-2009, 10:57 PM
  8. user form input
    By Brian Matlack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 04:27 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