Code to enable "copy" in commandbarcontrol

  • Thread starter Thread starter Jonsson
  • Start date Start date
J

Jonsson

Hi,

I have found this code from the forum.

It works alright, but I would like to ad the command "copy" as enabled
So that the only commands are "copy" and "paste values"(ID370) i
commandbarcontrol.

Sub Test_Cell_Menu()
Dim Ctl As CommandBarControl
For Each Ctl In CommandBars("Cell").Controls
Ctl.Enabled = False
Next Ctl
Application.CommandBars("cell").Controls. _
Add Type:=msoControlButton, ID:=370, before:=1
End Sub

Any help is apprecciated

//Thoma
 
Try this

Sub Test_Cell_Menu()
Dim Ctl As CommandBarControl
For Each Ctl In CommandBars("Cell").Controls
If Ctl.ID <> 19 Then
Ctl.Enabled = False
End If
Next Ctl
Application.CommandBars("cell").Controls. _
Add Type:=msoControlButton, ID:=370, before:=1
End Sub
 
Back
Top