Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

10 Temmuz 2004 Cumartesi

Enabled / Disable Cut And Paste


'Module1

Option Explicit
Dim CB As CommandBar
Dim CBC As CommandBarControl

Sub DisableCutAndPaste()
On Error GoTo 0
EnableControl 21, False 'Cut
EnableControl 19, False 'Copy
EnableControl 22, False 'Paste
EnableControl 755, False 'PasteSpecial
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "+{DEL}", ""
Application.OnKey "+{INSERT}", ""
Application.CellDragAndDrop = False
End Sub
Sub EnableCutAndPaste()
On Error GoTo 0
EnableControl 21, True 'Cut
EnableControl 19, True 'Copy
EnableControl 22, True 'Paste
EnableControl 755, True 'PasteSpecial
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "+{DEL}"
Application.OnKey "+{INSERT}"
Application.CellDragAndDrop = True
End Sub
Sub EnableControl(Id As Integer, Enabled As Boolean)
On Error Resume Next
For Each CB In Application.CommandBars
Set CBC = CB.FindControl(Id:=Id, Recursive:=True)
If Not CBC Is Nothing Then CBC.Enabled = Enabled
Next
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul