+ Reply to Thread
Results 1 to 11 of 11

Disable validation error messages

  1. #1
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184

    Disable validation error messages

    Is there a way to disable all error pop up messages from coming up due to an invalid entry in a cell that has data validation? So when a user types in a value, it doesn't pop up saying "retry, cancel, etc"? Just to save time and make it more user friendly, it would be nice to just dis-allow the entry, so when someone types an incorrect entry it just erases it or stays on the cell and keeps it highlighted but doesn't let you click away...something like that. This would be applied to the whole workbook and is for XL07. Thanks!
    Last edited by jman0707; 10-09-2008 at 12:51 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can allow users to only add values from a list using data validation
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Putting this in the sheets code module will do what you want.
    Please Login or Register  to view this content.
    But, I doubt the wisdom of presenting the user with a situation where "it doesn't work and it won't tell me why." In those situations, I tend to get creative and start pushing buttons behind machines and unplugging things.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184
    You can allow users to only add values from a list using data validation
    Yes, that's where I'm at now. But if they DON'T type in a correct value, it spits out an error message. I want that error message not to pop up. I want the worksheet to just wait on the cell until they DO type something in that works.

  5. #5
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184
    I tried the code but it didn't work. I must be pasting it in the wrong place. I'm pretty new to VBA. I tried pasting it into one specific worksheet's object, but it didn't take effect on that worksheet. Then I tried inserting a new module and pasting it there, still no luck. I DO want this to take effect for the entire workbook as well, so not sure if something needs to be changed. Can you help with where to paste this?


    But, I doubt the wisdom of presenting the user with a situation where "it doesn't work and it won't tell me why."
    And the validation is "whole numbers" and the users know it's impossible to record anything but whole numbers, but if they slip and work fast I don't want the results to show anything but whole numbers. So for accuracy of the end result I put a validation on the cells. The only thing the error box said is that I restricted use of this number anyway, so it provides no direction. That's why I'd like to disable it. Thanks!

  6. #6
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184
    Or this would be a good way to tackle this, but I don't know how to do it.

    Maybe just have code to round up the numbers entered to the nearest whole number, and I'll leave the validation so that it will error only if they enter negative numbers. Would it be able to round up before the validation error hit??? Not sure what order they go in. That way it would eliminate the need for them to type in another number, it would just round up and move on. So if they are not looking at the screen and just inputting info it won't even hesitate. They most likely will NEVER screw up the fact that they can't type negatives in there, the only screw ups will be decimals, that I can see of.

    I'm guessing the only way to round up a number entered where the entry cell and destination cell are the same is using VBA?

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    In the VB Editor, on the Project Explorer, in the Microsoft Excel Objects folder, double click the sheet you want this to effect. Copy/paste the code into the widow that appears.

    You might type Application.EnableEvents=True into the immediate window, just to make sure.

  8. #8
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184
    Got it, it works great thanks! Ignore my other post below, this works exactly as I'd hoped!

    Or this would be a good way to tackle this, but I don't know how to do it.

    Maybe just have code to round up the numbers entered to the nearest whole number, and I'll leave the validation so that it will error only if they enter negative numbers. Would it be able to round up before the validation error hit??? Not sure what order they go in. That way it would eliminate the need for them to type in another number, it would just round up and move on. So if they are not looking at the screen and just inputting info it won't even hesitate. They most likely will NEVER screw up the fact that they can't type negatives in there, the only screw ups will be decimals, that I can see of.

    I'm guessing the only way to round up a number entered where the entry cell and destination cell are the same is using VBA?

  9. #9
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184
    One more thing I didn't notice earlier. The worksheet that this will be used on is password protected. I tried using the code below

    Please Login or Register  to view this content.
    And

    Please Login or Register  to view this content.
    but I couldn't seem to place them in the right spot to get it to work. I've tried for awhile, but can't get it working. Can this code be modified to incorporate a password protected sheet? Thanks much! Here's the original code.

    Please Login or Register  to view this content.

  10. #10
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Put this in the ThisWorkbook code module (after adjusting the sheet's name, etc.), close the file, re-open it and it will work as you want.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184
    works great thanks mikerickson!

+ 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. disable validation on duplicate cells
    By twofootgiant in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2008, 04:20 AM
  2. Goto Letter in Validation List
    By bluepill in forum Excel General
    Replies: 2
    Last Post: 12-05-2007, 06:25 AM
  3. Trying to create complex list results, using validation lists, etc...
    By semantik in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-28-2007, 07:56 PM
  4. validation list/ worksheet protection
    By peacenpotatoes in forum Excel General
    Replies: 1
    Last Post: 05-24-2007, 10:40 AM
  5. Data Validation code
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2007, 06:50 PM

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