<span style=
"color:#e74c3c"
>Einmal das Modul:</span>
Option
Explicit
Option
Private
Module
Sub
KontextmenueErgaenzen()
Dim
oBtn
As
CommandBarButton
Dim
InI
As
Integer
For
InI = Application.CommandBars(
"Cell"
).Controls.Count
To
1
Step
-1
Application.CommandBars(
"Cell"
).Controls(1).Delete
Next
InI
For
InI = 1
To
25
Set
oBtn = Application.CommandBars(
"Cell"
).Controls.Add
With
oBtn
.Caption = Range(
"AbwK"
& InI).Value
.OnAction =
"'Färbe "
"AbwK"
& InI &
""
"'"
End
With
Next
End
Sub
Sub
Färbe(
ByVal
sBereich
As
String
)
With
ActiveCell
.Interior.Color = Application.Names(sBereich).RefersToRange.Interior.Color
.Value = Application.Names(sBereich).RefersToRange.Value
End
With
End
Sub
Sub
KontextmenueZuruecksetzen()
On
Error
Resume
Next
Application.CommandBars(
"Cell"
).Reset
End
Sub