1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
| Sub apparitiondelabarre()
On Error Resume Next
Application.CommandBars("outdoor exposure toolbar").Delete
On Error GoTo 0
With Application.CommandBars.Add(Name:="outdoor exposure toolbar")
'on la positionne en haut à droite
Application.CommandBars("outdoor exposure toolbar").Position = msoBarTop
Application.CommandBars("outdoor exposure toolbar").RowIndex = msoBarRowFirst
With .Controls.Add(Type:=msoControlPopup)
.Caption = "File"
.Controls.Add Type:= _
msoControlButton, ID:=23
With .Controls.Add(msoControlButton)
.TooltipText = "update delta and graphs" ' info bulle
.OnAction = "boutonupdate" ' macro à lancer
.Caption = "Update" ' texte de la ligne
End With
With .Controls.Add(msoControlButton)
.TooltipText = "Print this page"
.OnAction = "impressionunefeuille"
.Caption = "Print"
End With
With .Controls.Add(msoControlButton)
.TooltipText = "close and save the actual file"
.OnAction = "closeandsave"
.Caption = "Close and Save"
End With
End With
'copier coller
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Copy and Paste"
.TooltipText = "Copy and Paste"
.Controls.Add Type:= _
msoControlButton, ID:=19
.Controls.Add Type:= _
msoControlButton, ID:=22
End With
' pour les feuilles
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Data sheets"
.TooltipText = "Allow you to reach data sheets"
For Each feuille In ActiveWorkbook.Sheets
If Left(feuille.Name, 2) <> "Z_" _
And Left(feuille.Name, 3) <> "ZZ_" Then
With .Controls.Add(msoControlButton)
.TooltipText = feuille.Name
.Caption = feuille.Name
.OnAction = "'affichagefeuillle """ & .Caption & """'"
End With
End If
Next feuille
End With
' pour les graphes
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Graphs"
.TooltipText = "Allow you to reach graphs sheets"
For Each feuille In ActiveWorkbook.Sheets
If Left(feuille.Name, 2) = "Z_" Then
feuilletr = Right(feuille.Name, Len(feuille.Name) - 2)
With .Controls.Add(msoControlButton)
.TooltipText = feuille.Name
.Caption = feuilletr
.OnAction = "'affichagefeuillle """ & "Z_" & .Caption & """'"
.Caption = feuilletr
End With
End If
Next feuille
End With
' pour les rapports
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Reports"
.TooltipText = "Allow you to reach Reports sheets"
For Each feuille In ActiveWorkbook.Sheets
If Left(feuille.Name, 3) = "ZZ_" Then
feuilletr = Right(feuille.Name, Len(feuille.Name) - 3)
With .Controls.Add(msoControlButton)
.TooltipText = feuille.Name
.Caption = feuilletr
.OnAction = "'affichagefeuillle """ & "ZZ_" & .Caption & """'"
End With
End If
Next feuille
End With
.Protection = msoBarNoMove
.Visible = True
End With
End Sub
Sub apparitiondelabarresouris()
'Efface tout les boutons de la souris
For z = 1 To Application.CommandBars("Cell").Controls.Count
With Application.CommandBars("Cell")
.Controls(z).Visible = False
'sinon avec l'index des boutons sur la souris remplacer par 'z'
End With
Next
With Application.CommandBars("Cell")
With .Controls.Add(Type:=msoControlPopup)
.Caption = "File"
With .Controls.Add(msoControlButton)
.TooltipText = "update delta and graphs" ' info bulle
.OnAction = "MonAutreMacro" ' macro à lancer
.Caption = "Update" ' texte de la ligne
End With
With .Controls.Add(msoControlButton)
.TooltipText = "Print this page"
.OnAction = "impressionunefeuille"
.Caption = "Print"
End With
With .Controls.Add(msoControlButton)
.TooltipText = "close and save the actual file"
.OnAction = "MonAutreMacro"
.Caption = "Close and Save"
End With
End With
'copier coller
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Copy and Paste"
.TooltipText = "Copy and Paste"
.Controls.Add Type:= _
msoControlButton, ID:=19
.Controls.Add Type:= _
msoControlButton, ID:=22
End With
' pour les feuilles
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Data sheets"
.TooltipText = "Allow you to reach data sheets"
For Each feuille In ActiveWorkbook.Sheets
If Left(feuille.Name, 2) <> "Z_" _
And Left(feuille.Name, 3) <> "ZZ_" Then
With .Controls.Add(msoControlButton)
.TooltipText = feuille.Name
.Caption = feuille.Name
.OnAction = "'affichagefeuillle """ & .Caption & """'"
End With
End If
Next feuille
End With
' pour les graphes
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Graphs"
.TooltipText = "Allow you to reach graphs sheets"
For Each feuille In ActiveWorkbook.Sheets
If Left(feuille.Name, 2) = "Z_" Then
feuilletr = Right(feuille.Name, Len(feuille.Name) - 2)
With .Controls.Add(msoControlButton)
.TooltipText = feuille.Name
.Caption = feuilletr
.OnAction = "'affichagefeuillle """ & "Z_" & .Caption & """'"
.Caption = feuilletr
End With
End If
Next feuille
End With
' pour les rapports
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Reports"
.TooltipText = "Allow you to reach Reports sheets"
For Each feuille In ActiveWorkbook.Sheets
If Left(feuille.Name, 3) = "ZZ_" Then
feuilletr = Right(feuille.Name, Len(feuille.Name) - 3)
With .Controls.Add(msoControlButton)
.TooltipText = feuille.Name
.Caption = feuilletr
.OnAction = "'affichagefeuillle """ & "ZZ_" & .Caption & """'"
End With
End If
Next feuille
End With
End With
Application.CommandBars("Cell").Enabled = True
End Sub
Sub MasqueTouteslesfeuillesdeblank()
Application.ScreenUpdating = False
'masque les onglets
'With ActiveWindow
'.DisplayWorkbookTabs = Not .DisplayWorkbookTabs
'End With
On Error Resume Next
' masque les en-tête de ligne et de colonne
ActiveWindow.DisplayHeadings = False
'masque la boîte à outils et le menu
Dim I As Integer
With Application.CommandBars
For I = 1 To .Count
If .Item(I).Enabled _
Then .Item(I).Enabled = False
Next I
Application.CommandBars("Toolbar list").Enabled = False
End With
' masque la barre de formule
Application.DisplayFormulaBar = False
'Application.ScreenUpdating = True
End Sub |
Partager