LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code to disable "paste" as an option

Hi,

I have got this code from the forum, and it works great, but can anyon
help me to modify it a little bit?

I want it to disable "paste" so that the only option that is possibl
should be "paste special", "values".


Any help is appreciated!

Thomas

Sub Nocut()

Dim oCtls As CommandBarControls, oCtl As CommandBarControl
Set oCtls = CommandBars.FindControls(ID:=21) ''Cut
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = False
Next
End If
Set oCtls = CommandBars.FindControls(ID:=522) ''Options
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = False
Next
End If
With Application
.OnKey "^x", ""
.OnKey "+{Del}", ""
.CellDragAndDrop = False

End With

End Su

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i disable/enable "Worksheet Move or copy" option? Saon Excel Worksheet Functions 1 May 15th 08 06:30 PM
Disable collate "on" option? dogmelissa Excel Discussion (Misc queries) 4 December 15th 06 10:05 PM
Disable "save" option on close. PG Excel Discussion (Misc queries) 2 September 6th 06 12:15 AM
How to set a default paste option of "Match Destination Format" John H @ EBR Excel Discussion (Misc queries) 1 April 17th 06 09:59 PM
Modify code to disable "paste" Jonsson[_34_] Excel Programming 0 June 17th 04 09:10 AM


All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"