LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default VBA - Data Validation (Looking for NERD help)

My hero!

Thank you friend, Top Tip is very usefull

Chris

--
Christoffer Bloch Andersen


"Simon Lloyd" wrote:


I think you will be able to make good use of a "Top Tip" that one of our
members here at The Code Cage posted, it deals with your problem
exactly!
http://tinyurl.com/bcbmyj

Christoffer Bloch Andersen;238906 Wrote:
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:


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 if my copy paste violate the DV criteria?

I hope my question is understandable
Thank you

BR
Chris Bloch

--
Christoffer Bloch Andersen



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=66705


 
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
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM
Excel is paranoid, and I'm an annoyed nerd. John O'Flaherty Excel Discussion (Misc queries) 0 December 3rd 04 06:17 PM


All times are GMT +1. The time now is 11:13 PM.

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

About Us

"It's about Microsoft Excel"