Allow paste special only to one worksheet and not to all
On Mar 6, 3:04*am, Ritwik Shukla
wrote:
Try this for paste....
Sheets("Nameof Sheet").Range("LocationofRange").PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
-------------
"SANDIND" wrote:
I have the following code for allowing only Paste special to workbook I am
working,
I have assigned shortcut (ctrl + v) to same. I Thought that same will work
only in one sheet as I have my code in Sheet1 of workbook, but once i use
CtrlV its only pasting Value not only to other sheets but also to other
workbooks, Is there anyway to restrict that to one sheet/workbook.
Code :
Sub MyPasteValues()
* * If Application.CutCopyMode = False Then
* * * * Beep
* * Else
* * * * ActiveCell.PasteSpecial Paste:=xlPasteValues
* * End If
End Sub
Thanks for your help in advance,
PP
Try putting your code into events in the ThisWorkbook class. As you
Activate/Deactivate the workbook or SheetChange the worksheets you can
control when to allow xlPasteValues and when to allow pasting.
Matt
|