ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Data Validation - repost (https://www.excelbanter.com/excel-discussion-misc-queries/201776-data-validation-repost.html)

RaulDR

Data Validation - repost
 
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!


muddan madhu

Data Validation - repost
 
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


On Sep 8, 10:26*pm, RaulDR wrote:
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!



RaulDR

Data Validation - repost
 
Thanks Muddan!

"muddan madhu" wrote:

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


On Sep 8, 10:26 pm, RaulDR wrote:
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!





All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com