Results 1 to 6 of 6

Produce error message when pasted values break validation rules

Threaded View

  1. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Produce error message when pasted values break validation rules

    Something like this?

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Not Intersect(Target, Range("ValidationRange")) Is Nothing Then
            Me.CircleInvalid
        End If
    End Sub
    This assuming you have named range ValidationRange where you apply the validation range. You can change with some range address or whatever.

    In more general terms

    Private Sub Worksheet_Change(ByVal Target As Range)
        Me.CircleInvalid
    End Sub
    Note that validation rule will be cleared if you paste from cell where there is no validation rule
    Last edited by buran; 04-01-2015 at 07:14 AM.
    If you are pleased with a member's answer then use the Star icon to rate it.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Look at last pasted cell and if the same give me an error message box
    By jharaldson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2011, 08:05 PM
  2. Validation on Pasted Values
    By grey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2009, 12:16 PM
  3. [SOLVED] cell validation even for values pasted into cells-Is there a way to validate values ?
    By JR_06062005 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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