Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Data validation error msg

0

I'm using the following:

"=AND(LEN(I7)>1)

but it does not allow the user to place more than 12 charecters including spaces.

I need at least 20 preferably 25. The minimum is 1

Answer
Discuss

Answers

0
Selected Answer

Martin

The problem is that there is data validation already set on cell I7- it limits the text length to between 1 and 12 characters (as you have found- and see the yellow cell/ screen grab in the attached file).

I've now set it to 25 characters and changed the Error Alert message (so your users know why their input has failed).

You can see/ change validation by going Data (ribbon) /Data Tools then the bottom button (green tick plus red stop sign and down arrow) and pick Data Validation.

If you check on the Tutorial section, there's a subsection on Data Validation with some interesting tips from Don. On its own, this is that sub-section- Data Validation in Excel

Hope this helps.

Discuss

Discussion

Hi John thanks for your answer but it did not work..I can wait till you are able access my file
Martin100 (rep: 6) Aug 12, '21 at 10:48 am
Okay, will reply in about an hour (so you might get another answer meantime) 
John_Ru (rep: 6142) Aug 12, '21 at 10:59 am
Martin. Have completely changed my answer (having seen the file)! Should be good now.
John_Ru (rep: 6142) Aug 12, '21 at 12:00 pm
I copied & paste, it is returning a "1", i needit to return "TRUE" and i'm still getting the error msg when the input is too long.
Martin100 (rep: 6) Aug 12, '21 at 12:04 pm
Martin. See the revised Answer and file. I fixed the data validation in I7.

If that isn't what you wanted, what are you trying to do?
John_Ru (rep: 6142) Aug 12, '21 at 12:14 pm
Thanks John, my apologies for my ignorance..the answer was a great reminder
Martin100 (rep: 6) Aug 12, '21 at 12:27 pm
No problem Martin (and thanks for selecting my Answer).

You're definitely not ignorant, it's just that Excel has so many facets that it's easy for all of us to forget things.
John_Ru (rep: 6142) Aug 12, '21 at 12:29 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login