XL 2013 Affichage CommandBar

Boulanger Serge

XLDnaute Nouveau
Bonjour à Tous,

Je cherche à sélectionner toutes les cellules non verrouillées de ma feuille.
Mais rien ne s'affiche. Quelqu'un peut-il m'aider?

J'ai un module qui contient ces deux procédures:

VB:
Sub SelectNonVer()
  Set champ = Nothing
  For Each c In ActiveSheet.UsedRange
    If Not c.Locked Then
      If champ Is Nothing Then
        Set champ = c
      Else
        Set champ = Union(champ, c)
      End If
    End If
  Next c
  champ.Select
End Sub

Sub auto_open()
  On Error Resume Next
  CommandBars("BarreVer").Delete
  Dim barre As CommandBar
  Dim bouton As CommandBarControl
  Set barre = CommandBars.Add(Name:="BarreVer")
  barre.Visible = True
  Set bouton = CommandBars("BarreVer").Controls.Add(Type:=msoControlButton)
  bouton.Style = msoButtonCaption
  bouton.OnAction = "SelectNonVer"
  bouton.Caption = "Selection cellules non verrouillées"
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
312 294
Messages
2 086 902
Membres
103 404
dernier inscrit
sultan87