ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Restricting Paste in Excel (https://www.excelbanter.com/excel-programming/371685-restricting-paste-excel.html)

FCS

Restricting Paste in Excel
 
How can I restrict the "Paste" functionality in Excel to prevent the user
from pasting cell formats when copying and pasting? (i.e. only allowing
pasting values and/or formulas)

I am using Excel 2003

stevebriz

Restricting Paste in Excel
 
this might help you

http://p2p.wrox.com/topic.asp?TOPIC_ID=47526

FCS wrote:
How can I restrict the "Paste" functionality in Excel to prevent the user
from pasting cell formats when copying and pasting? (i.e. only allowing
pasting values and/or formulas)

I am using Excel 2003



NickHK

Restricting Paste in Excel
 
This may give you a start. However, I can't seea way to differentiate a
..Paste from a .PasteSpecial, so you may have .Undo, then .PasteSpecial of
what you wish to allow.
Check the address of Target to see if you wish to control that range.

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"
'To disable .Paste
.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

"FCS" wrote in message
...
How can I restrict the "Paste" functionality in Excel to prevent the user
from pasting cell formats when copying and pasting? (i.e. only allowing
pasting values and/or formulas)

I am using Excel 2003




[email protected]

Restricting Paste in Excel
 
Hi FSC,

I've tried this :
Sub diab()
Application.OnKey "^{v}", ""
Application.CommandBars.FindControl(ID:=22).Enable d = False
End Sub


Rgds,

Halim

FCS menuliskan:
How can I restrict the "Paste" functionality in Excel to prevent the user
from pasting cell formats when copying and pasting? (i.e. only allowing
pasting values and/or formulas)

I am using Excel 2003




All times are GMT +1. The time now is 06:42 AM.

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