View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Power Loser Power Loser is offline
external usenet poster
 
Posts: 1
Default Allow paste special only to one worksheet and not to all

Thanks Matt for your reply,

I am new user to VB, it would be kind of you if you can explain the process
in detail if possible. i.e how to use activate -deactivate option.

Thanks again.

PP

" wrote:

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