Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 417
  • Last Modified:

Data Validation - does it carry over to form created via Excel not VBA Editor?

Been asked some questions about form creation. I have someone who wants her data entered in a particular way. e.g dates only to be entered in a certain way etc. So assuming that is set up via Data Validation - does that carry over to a form entered instantly (via the Form icon in New Excel) .
Or would she be better off creating it via User Forms in VBA Editor (bearing in mind she has no VBA experience?
Thanks as always..
0
agwalsh
Asked:
agwalsh
  • 3
  • 3
  • 2
3 Solutions
 
GrahamSkanRetiredCommented:
Data Validation (via the button in the Data Tools group on the Data tab) is independent of VBA as User forms.

If the requirements can be met with this, then go for that.  Only use VBA if the need is very complex.

If a new workbook is created from the original, then any such validation and also any VBA in the original will be carried over to the new one.
0
 
Rob HensonIT & Database AssistantCommented:
I don't believe Graham's answer addresses your question.

You have a list of data which includes a date field which has Data Validation (DV) set to allow only entry of a date.

You have implemented the standard built in Form option for ease of entering new data and want to know if the DV is included on the Form.

Strictly speaking the answer is no. However, if the column of data for the dates already has the DV set then the entry from the form input will be rejected if it isn't a valid date.

Therefore, the way round is to ensure that the DV settings are continued down the column beyond the existing entry.

Thanks
Rob H
0
 
agwalshAuthor Commented:
OK, so the answer is that Yes, the form can be implemented and yes the data validation will carry over - as long as it's copied down for as many rows as the user thinks data entry will be required. Will the input messages/error alerts still work?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Rob HensonIT & Database AssistantCommented:
Input Messages - no I don't believe so.

Error Messages - Yes they still show, the form is trying to "pass" an entry to the sheet and if that entry is invalid then the error message will be triggered.

Thanks
Rob H
0
 
GrahamSkanRetiredCommented:
I'm less sure that I fully understand your question, but to be specific, any UserForms and their code will carry over when whole new workbook is created from the original.

Copying and pasting areas of a sheet won't copy user forms, but any data validation in the copied cells will be copied via a copy and standard paste.
0
 
agwalshAuthor Commented:
So here's what I'm thinking..
someone has a spreadsheet set up - complete with headings etc.
Data Validation is applied to a range underneath those headings.
To facilitate data entry a form is created (using the Forms icon from the QAT) - is it true to say that the data validation settings will carry over to that form complete with error messages e.g. "this entry is a duplicate - please enter a unique value" sort of thing...?? thanks
0
 
Rob HensonIT & Database AssistantCommented:
Graham,

User is using the Standard Data form not a User Form and is not creating a new file only entering new data into an existing list.

Form icon is not visible in default Data Toolbar but I have just added it through the Customise ribbon options.

To get the form to show without the button, the old fashioned keyboard shortcut is "Alt+D+O" when cursor is in the data list. It creates a simple input form using the header row as field names and the sheet name as the Form name.

Question is, when using this form does the Data Validation on the sheet get applied to the entries via the form. The answer is yes, the form tries to pass an entry to a DV restricted field so the entry has to match the DV requirements.

For the input message, if the cursor is in a cell which has the DV rule set, the input message will show. This message stays visble when the form appears.

Thanks
RH

EDIT to last line:

...if the cursor is in a cell which has the DV rule set, prior to the Form being invoked,
0
 
agwalshAuthor Commented:
Did the job...thank you :-)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now