Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Data Validation (copy paste error)

Hi

I currently have a problem with my Data Validation.

I need to be able to copy paste (special - values) in the range of where my
DV is, but by doing so it will override the DV.

I can (through VBA) make sure that copy paste will be disabled
by this code:

Private Sub Worksheet_Change(ByVal Target As Range)
'Does the validation range still have validation?
If HasValidation(Range("ValidationRange")) Then
Exit Sub
Else
Application.Undo
MsgBox "Your last operation was canceled." & _
"It would have deleted data validation rules.", vbCritical
End If
End Sub

Private Function HasValidation(r) As Boolean
' Returns True if every cell in Range r uses Data Validation
On Error Resume Next
x = r.Validation.Type
If Err.Number = 0 Then HasValidation = True Else HasValidation = False
End Function

But since I have to copy paste thousands of lines this is needed.

So my question to you:

Is it possible to copy paste in the DV field without destroying the DV
and also notify me is my copy paste violate the DV criteria?

I hope my question is understandable
Thank you

BR
Chris Bloch
--
Christoffer Bloch Andersen
Trainee
NNE Pharmaplan A/S
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation (copy paste error) Christoffer Bloch Andersen Excel Worksheet Functions 0 January 26th 09 11:53 AM
Copy and Paste Validation List Error Yogin Excel Discussion (Misc queries) 3 August 10th 08 02:20 PM
problem data validation and copy/paste Theo Excel Worksheet Functions 2 January 13th 08 08:30 PM
Copy/Paste over rides data validation jk Setting up and Configuration of Excel 1 July 23rd 06 03:39 AM
Data validation does not seem to work with copy/paste LAF Excel Discussion (Misc queries) 1 September 15th 05 09:31 PM


All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"