Hallo,
Ich verwende z.Z. folgenden Makro um das Kopieren und Ausschneiden in einem Arbeitsblatt zu verhindern bzw wieder zu aktivieren.
Diesen möchte ich nun aber nur auf bestimmte Zellen anwenden bzw
bestimmte Zellen sollen/dürfen weiter hin kopiert und ausgeschnitten werden.
Ich hoffe jemand kann mir hier weiter helfen.
Sub Kopieren_Aktivieren()
'Tastenkombinationen einschalten
Application.OnKey "^x"
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "+{DEL}"
Application.OnKey "+{INSERT}"
'Drag & Drop wieder erlauben
Application.CellDragAndDrop = True
'Schaltflaechen in Menüleiste => Bearbeiten aktivieren
procControlEnableDisable 21, True ' Ausschneiden
procControlEnableDisable 19, True 'Kopieren
procControlEnableDisable 22, True 'Einfuegen
procControlEnableDisable 755, True 'Inhalte einfuegen
procControlEnableDisable 809, True 'Office-&Zwischenablage
End Sub
Sub Kopieren_Deaktivieren()
'Tastenkombinationen deaktivieren
Application.OnKey "^x", ""
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "+{DEL}", ""
Application.OnKey "+{INSERT}", ""
'Drag & Drop ausschalten
Application.CellDragAndDrop = False
'Schaltflaechen in Menüleiste => Bearbeiten deaktivieren
procControlEnableDisable 21, False ' Ausschneiden
procControlEnableDisable 19, False 'Kopieren
procControlEnableDisable 22, False 'Einfuegen
procControlEnableDisable 755, False 'Inhalte einfuegen
procControlEnableDisable 809, False 'Office-&Zwischenablage
End Sub
Sub procControlEnableDisable(intId As Integer, _
bolStatus As Boolean)
Dim cmbSuche As CommandBar
Dim cmbcSteuerelement As CommandBarControl
On Error Resume Next
For Each cmbSuche In Application.CommandBars
Set cmbcSteuerelement = _
cmbSuche.FindControl(ID:=intId, recursive:=True)
If Not cmbcSteuerelement Is Nothing Then
cmbcSteuerelement.Enabled = bolStatus
End If
Next
End Sub
|