bonjour a tous
voila j'utilise ce code pour interdir l'insertion et la suppression de lignes et colonnes ce qui a pour effet de grisser dans les menus les accés
jusque la tout va bien
le souci etant qui faudrai lorsque je quitte mon classeur que ces ajout et suppression de colonne redevienne disponible merci de votre aide a tous
Sub test()
Set mescontrol = CommandBars("Cell").Controls
For Each i In mescontrol
'MsgBox i.Caption
Select Case i.Caption
Case Is = "&Insérer..."
i.Enabled = False
Case Is = "&Supprimer..."
i.Enabled = False
End Select
Next
Set mescontrol = CommandBars("Row").Controls
For Each i In mescontrol
' MsgBox i.Caption
Select Case i.Caption
Case Is = "&Insertion"
i.Enabled = False
Case Is = "&Supprimer..."
i.Enabled = False
End Select
Next
Set mescontrol = CommandBars("column").Controls
For Each i In mescontrol
' MsgBox i.Caption
Select Case i.Caption
Case Is = "&Insertion"
i.Enabled = False
Case Is = "&Supprimer"
i.Enabled = False
End Select
Next
Set mescontrol = CommandBars(1).Controls
For Each i In mescontrol
Set mesboutons = i.Controls
For Each c In mesboutons
Select Case c.Caption
Case Is = "&Lignes"
c.Enabled = False
Case Is = "C&olonnes"
c.Enabled = False
End Select
Next
Next
End Sub
amicalement ghislain
voila j'utilise ce code pour interdir l'insertion et la suppression de lignes et colonnes ce qui a pour effet de grisser dans les menus les accés
jusque la tout va bien
le souci etant qui faudrai lorsque je quitte mon classeur que ces ajout et suppression de colonne redevienne disponible merci de votre aide a tous
Sub test()
Set mescontrol = CommandBars("Cell").Controls
For Each i In mescontrol
'MsgBox i.Caption
Select Case i.Caption
Case Is = "&Insérer..."
i.Enabled = False
Case Is = "&Supprimer..."
i.Enabled = False
End Select
Next
Set mescontrol = CommandBars("Row").Controls
For Each i In mescontrol
' MsgBox i.Caption
Select Case i.Caption
Case Is = "&Insertion"
i.Enabled = False
Case Is = "&Supprimer..."
i.Enabled = False
End Select
Next
Set mescontrol = CommandBars("column").Controls
For Each i In mescontrol
' MsgBox i.Caption
Select Case i.Caption
Case Is = "&Insertion"
i.Enabled = False
Case Is = "&Supprimer"
i.Enabled = False
End Select
Next
Set mescontrol = CommandBars(1).Controls
For Each i In mescontrol
Set mesboutons = i.Controls
For Each c In mesboutons
Select Case c.Caption
Case Is = "&Lignes"
c.Enabled = False
Case Is = "C&olonnes"
c.Enabled = False
End Select
Next
Next
End Sub
amicalement ghislain