Data Validation - repost

R

RaulDR

Hi All,

I created a worksheet which has a validation that prevent duplicate entries.
The validation is working fine if the user types the value. My question is
how can I make excel to validate the values that the user copy from another
worksheet and paste to my worksheet.

Thanks!
 
M

muddan madhu

Try this one (source : mrexcel)

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
With Application
..CutCopyMode = False
..OnKey "^c", ""
End With
End Sub

Private Sub Workbook_Activate()
With Application
..CutCopyMode = False
..OnKey "^c", ""
End With
End Sub

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal
Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right click menu deactivated." & vbCrLf & _
"Cannot cut, copy, paste, or ''drag & drop''.", 16, "For this file:"
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)
Application.CutCopyMode = False
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
With Application
..OnKey "^c", ""
..CutCopyMode = False
End With
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.CutCopyMode = False
End Sub
 
R

RaulDR

Thanks Muddan!

muddan madhu said:
Try this one (source : mrexcel)

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
With Application
..CutCopyMode = False
..OnKey "^c", ""
End With
End Sub

Private Sub Workbook_Activate()
With Application
..CutCopyMode = False
..OnKey "^c", ""
End With
End Sub

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal
Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right click menu deactivated." & vbCrLf & _
"Cannot cut, copy, paste, or ''drag & drop''.", 16, "For this file:"
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)
Application.CutCopyMode = False
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
With Application
..OnKey "^c", ""
..CutCopyMode = False
End With
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.CutCopyMode = False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top