If u are looking for manual entry then press.
Ctrl+Shift+:
& Change the cell format as required.
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
Thank youHi ,
I do not know what you are talking about.
If you click on Data Validation , and select Time , you can enter the start time of 00:00 and the end time of 23:59.
If this has been done , how can anyone enter text in these cells ?
Copy + paste will always remove any Data Validation that is present in a cell ; it has nothing to do with whether the DV is through a formula or otherwise.
Narayan
In that case you need to implement 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
http://forum.chandoo.org/threads/data-validation-list-override-when-copy-pasted.11933/
http://www.j-walk.com/ss/excel/tips/tip98.htm