+ Reply to Thread
Results 1 to 15 of 15

3 columns - conditions - mandatory for filling with data

  1. #1
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Question 3 columns - conditions - mandatory for filling with data

    HI,


    I have a table with 3 columns: quantity / unit measure / amount.

    2 of them are mandatory to be filled with data (quantity and amount). If one of the columns has no data to be entered, "n/a" should be entered anyway. (message box for attentioning if empty)
    The colum unit measure is manadatory if the column quantity contains a number.
    If the column quantity contains "n/a", the column unit measure should be automatically filled with "n/a", but if the column quantity contains a number, for the unit measurecolumn a message should appear "please fill in unit measure".

    please advise.

    Thank you!

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: 3 columns - conditions - mandatory for filling with data

    Do you want to do this as you are manually entering the quantity or "N/A" in the "quantity" column?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Re: 3 columns - conditions - mandatory for filling with data

    if possible, yes.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: 3 columns - conditions - mandatory for filling with data

    The macro assumes your data is in columns A:C. Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter your data in column A and press the ENTER key.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Re: 3 columns - conditions - mandatory for filling with data

    Hi, looks great.
    I still have a problem with it ... if i paste more than 1 row (for ex I have a list to paste in and some data is missing) (and i will have the case) i have error message n line "If Target = "n/a" Then" ... can you also help with this?
    thank you!

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: 3 columns - conditions - mandatory for filling with data

    Can you attach a copy of your file? De-sensitize the data if necessary. Explain in detail what you want to do referring to specific cell, rows and columns.

  7. #7
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Re: 3 columns - conditions - mandatory for filling with data

    i cannot attach excel... I copied something here, if you paste it in excel, it's a bit more organized

    ccode cname transaction detail

    date:

    info 1 info 2 info 3 quantity quantity measure amount info 4 info 5 the quantity and the amount - mandatory to be filled. If no data is to be entered, n/a shoud appear
    row1 if quantity is a number, then quantity measure is mandatory
    row2
    row3
    row4
    row5
    row6

    the table an grow with rows



    The columns marked with yellow are mandatory.
    I could set them as mandatory, (A loop in a separate sheet, with the table heather lines markes with M, and there's a loop that looks up every range if marked with M and asks data to be entered). But in the case D5:F5, I have the issue, because the quantity measure should only be mandatory if the quantity is a number
    I cannot send you my file, because is really big and contains lots of confiential data… sory
    I on't know if the change can be used again … I already have a change by val, because the file contains lots of transaction details, and the table heather changes when the transaction detail is changing


    Ranges:
    FirstToBeFilled A6, set as mandatory in all cases - the form cannot be sent if this is empty
    Table1 the table A6:H12, in this case

    in the picture you can see the 3 possible cases that can appear when filling in data.


    Capture.JPG

    Hope it helps in helping me ... thank you for your time!

  8. #8
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Re: 3 columns - conditions - mandatory for filling with data

    myfile.xlsx

    i did it ... attached

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: 3 columns - conditions - mandatory for filling with data

    I need some more information for clarification.
    When filling out your form, you would start by entering data in A6. This cell must be filled before any data in D6, E6, F6 and H6 can be entered. Is this correct?
    If "N/A" is entered in D6 then E6 should also contain "N/A". In this case, do you want F6 and H6 to be mandatory?
    Before sending the form, do you always save it? If so, we can have a macro check the mandatory cells to make sure they are filled before allowing the file to be saved.

  10. #10
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Re: 3 columns - conditions - mandatory for filling with data

    The data entering always starts with A6. this cell is mandatory before any other cell is filled in.
    If "N/A" is entered in D6 then E6 should also contain "N/A", and then in F6 the amount is mandatory. H6 (and many others in my form) is mandatory.
    I only have the problem connecting these 3 columns somehow.

    The example you made the first time, was ok, but it shoul work even if data is pasted from an another source.
    your proposal: a macro to check the mandatory cells to make sure they are filled before allowing the file to be saved is what i need

    In my form, i have many buttons. And one of them checks the mandatory fileds to be filled in. I just need to connect the 3 columns - i guess i just need the idea for this. I tought your first solution was ok, until I pasted the many data and it just stopped ...

    thanks!

  11. #11
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: 3 columns - conditions - mandatory for filling with data

    Upon further thought, I don't think that the "before saving" approach will work. You said that you already had a Worksheet_Change macro in your workbook. Perhaps we can add the necessary code to that macro. In order to do this, I would need you to post your Worksheet_Change macro so I can try to add to it. Could you post it here?

  12. #12
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Re: 3 columns - conditions - mandatory for filling with data

    myfile.xlsm
    attached with code.
    thank you for your time!

  13. #13
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: 3 columns - conditions - mandatory for filling with data

    Try the attached file.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    01-11-2019
    Location
    Transilvania
    MS-Off Ver
    2007
    Posts
    10

    Re: 3 columns - conditions - mandatory for filling with data

    Hi, I have checked the file, but it still isn't what i need... it works if it is filled line by line, but...
    It has to be ok even for much data added from other data tables too.
    All those message boxes are not ok. My users will not like it.
    It should let the user fill in data, and when it signes for approval, if it's the case, fill in the n/a for the quantity measure if the quantity is n/a, and check if the unit measure is missing when the quantity is numeric. Also make the check for the amount not to be empty (should be n/a or amount - anounce the user in any case)

    i am so sorry for bugging you this much ... i am just stuck with this problem and cannot move on

  15. #15
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: 3 columns - conditions - mandatory for filling with data

    Place this macro in the code module for ThisWorkbook. It will check the data when you try to save the file. If any data is missing, it will inform you and the save will be cancelled. If all data is OK, the file will be saved.
    Please Login or Register  to view this content.

+ 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. [SOLVED] Filling multiple columns data in one go using different criteria:confused:
    By 0Cool in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-03-2019, 11:04 AM
  2. Filling a formula pattern across columns using data from one row
    By Wrenthebird in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-25-2015, 08:16 PM
  3. [SOLVED] How to create a formula where I have two mandatory conditions and an optional one
    By Bruno Silva in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-08-2015, 08:39 AM
  4. Filling matrix depending on conditions
    By sharpxs in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2014, 06:06 AM
  5. Mandatory field required message when user skips mandatory fields
    By Bharathi27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2013, 05:12 AM
  6. Auto filling a form with conditions
    By matt1020 in forum Excel General
    Replies: 2
    Last Post: 11-12-2012, 02:17 PM
  7. Filling cells depending on two conditions
    By dziw in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2005, 11:29 AM

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