View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default disallowing copying of rows

Try this. You can't stop the Copy, but you can stop the Paste.
Depending on your needs, you can a check of the Target invloved, to see if
it is allowed or not.

Dim Cutting As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Msg As String

With Application
Select Case .CutCopyMode
Case False
If Cutting Then
Msg = "Was Cut"
Else
Msg = "Normal Entry"
End If
Case xlCopy
Msg = "Pasted Copy"
.EnableEvents = False
.Undo
.EnableEvents = True
End Select
End With
MsgBox Msg

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cutting = (Application.CutCopyMode = xlCut)
End Sub

NickHK

wrote in message
oups.com...
Is it possible to disallow copying of rows.
I just dont want a row to be copied and pasted, can anyone tell me how
to do that.
I am just trying to avoid the duplicate entries associated with a row.
For example, if rows are assigned a unique value(i have used validation
option), and then if someone copy and paste the value it allows it to
do so. In order to avoid that, I want to restrict a user to go for
copying a row and pasting it elsewhere.
Someone please help,
Regards,
Nasir.