Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 The macro do not work if copied cells already contain validation - specially if my range is a column & user will copy cells from the column. Can anybody help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
to: John Walkenbach - Face ID add-in | Excel Programming | |||
John Walkenbach Color Palette (Repost) | Excel Programming | |||
John Walkenbach Color Palette | Excel Programming | |||
Ensuring deleted data cannot be recovered | Excel Discussion (Misc queries) | |||
John Walkenbach Colour Palette | Excel Programming |