+ Reply to Thread
Results 1 to 6 of 6

Data validation

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Perth, WA
    MS-Off Ver
    Excel 2003
    Posts
    93

    Data validation

    I recorded a simple Data validation macro that displays a stop message when excel detects data outside a specific date range ie 01.07.2009 - 31.07.2009. The problem is its not working.
    The spreadsheet works by the user pasting July data into the sheet and then the data validation macro runs through the column with the date in it to ensure its the correct month.

    The problem is the data validation only works if you type the incorrect date in to the cell and not if you paste it. Any ideas?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Data validation

    Maybe seeing the code would help ...
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-12-2009
    Location
    Perth, WA
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Data validation

    Please Login or Register  to view this content.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Data validation

    That's true, data validation doesn't work when you paste.

    I thought you meant you were doing the validation in code, which is probably what you'll need to do. The alternative is writing code to flush the clipboard with every change in selection.

  5. #5
    Registered User
    Join Date
    08-12-2009
    Location
    Perth, WA
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Data validation

    I wonder if there is an IF statement that could be used to substitute the data validation function?? ie look through this array for this criteria and if false generate a msg box informing the user the data pasted is incorrect.

  6. #6
    Registered User
    Join Date
    08-12-2009
    Location
    Perth, WA
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Data validation

    I think I have a solution...

    Paste the data into Column B then run a simple cell reference in column A to the data in column B. This cell reference will make the cell active and trigger off the data validation rule.

    A few extra steps to the macro but the simplest answer I have found so far (and it wasn't by Googling haha)
    Last edited by hermithead; 02-23-2010 at 12:13 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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