Function MenuX()
Dim barre As CommandBar, i&,cpop ac object
On Error GoTo suite
delmenu
suite:
Set barre = CommandBars.Add("MenuSheetx", msoBarPopup, False, True)
Set cpop = barre.Controls.Add(msoControlPopup, 1, , , True)
cpop.Caption = "de 1 a 10"
For i = 1 To Sheets.Count
With cpop.Controls.Add(msoControlButton, 1, , , True)
.Caption = Sheets(i).Name & ":" & Sheets(i).CodeName
.Tag = i
.FaceId = 358
.OnAction = "openSheet"
End With
If i Mod 10 = 0 Then
Set cpop = barre.Controls.Add(msoControlPopup, 1, , , True)
cpop.Caption = "de " & i + 1 & " a " & i + 10
End If
Next
barre.ShowPopup
End Function