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 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
| Sub CommandButton700()
Application.ScreenUpdating = False
Dim objSaveBox As FileDialog
Dim sh As Shape
'
'
If EVCD = False And ANOT = False And ARPI = False And ATRA = False And AVEN = False And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
MsgBox "Vous devez selectionner au moins une feuille", vbInformation + vbOKOnly
Exit Sub
ElseIf EVCD = True And ANOT = False And ARPI = False And ATRA = False And AVEN = False And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
Sheets(Array("evenement conduite")).Select ' selectionne la feuille
Sheets(Array("evenement conduite")).Copy 'la copie
ActiveSheet.Unprotect Password:="SoLeNe84"
Sheets("evenement conduite").Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="SoLeNe84"
Sheets("evenement conduite").Select
Range("A1").Select
ElseIf EVCD = False And ANOT = True And ARPI = False And ATRA = False And AVEN = False And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
Sheets(Array("ANOT")).Select ' selectionne la feuille
Sheets(Array("ANOT")).Copy 'la copie
ActiveSheet.Unprotect Password:="SoLeNe84"
Sheets("ANOT").Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="SoLeNe84"
Sheets("ANOT").Select
Range("A1").Select
ElseIf EVCD = False And ANOT = False And ARPI = True And ATRA = False And AVEN = False And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
Sheets(Array("ARPI")).Select
Sheets(Array("ARPI")).Copy
ActiveSheet.Unprotect Password:="SoLeNe84"
Sheets("ARPI").Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="SoLeNe84"
Sheets("ARPI").Select
Range("A1").Select
Là, j'ai enlevé la suite car trop long ca va jusqu'à icab
End If
Set objSaveBox = Application.FileDialog(msoFileDialogSaveAs)
With objSaveBox
'Définit le type de fichier par défaut:
'(la valeur 4 Permet de spécifier les classeurs "Excel 97-2003" lorsque vous êtes dans Excel 2007)
.FilterIndex = 4
'Affiche la boîte de dialogue
.Show
'Enregistre
.Execute
End With
ActiveWindow.Close 'ferme le nouveau classeur
Unload UserForm20
Sheets("accueil").Select
Application.ScreenUpdating = True
CommandButton701
End Sub
Sub CommandButton701()
Application.ScreenUpdating = False
Dim objSaveBox As FileDialog
Dim sh As Shape
ElseIf EVCD = True And ANOT = True And ARPI = False And ATRA = False And AVEN = False And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
Sheets(Array("evenement conduite", "ANOT")).Select
Sheets(Array("evenement conduite", "ANOT")).Copy
Sheets("evenement conduite").Unprotect Password:="SoLeNe84"
Sheets("ANOT").Unprotect Password:="SoLeNe84"
Sheets(Array("evenement conduite", "ANOT")).Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
Sheets("evenement conduite").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="SoLeNe84"
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("ANOT").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("evenement conduite").Select
ElseIf EVCD = True And ANOT = False And ARPI = True And ATRA = False And AVEN = False And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
Sheets(Array("evenement conduite", "ARPI")).Select
Sheets(Array("evenement conduite", "ARPI")).Copy
Sheets("evenement conduite").Unprotect Password:="SoLeNe84"
Sheets("ARPI").Unprotect Password:="SoLeNe84"
Sheets(Array("evenement conduite", "ARPI")).Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
Sheets("evenement conduite").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="SoLeNe84"
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("ARPI").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("evenement conduite").Select
ElseIf EVCD = True And ANOT = False And ARPI = False And ATRA = True And AVEN = False And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
Sheets(Array("evenement conduite", "ATRA")).Select
Sheets(Array("evenement conduite", "ATRA")).Copy
Sheets("evenement conduite").Unprotect Password:="SoLeNe84"
Sheets("ATRA").Unprotect Password:="SoLeNe84"
Sheets(Array("evenement conduite", "ATRA")).Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
Sheets("evenement conduite").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="SoLeNe84"
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("ATRA").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("evenement conduite").Select
ElseIf EVCD = True And ANOT = False And ARPI = False And ATRA = False And AVEN = True And CBA = False And C = False And MAIL = False And MEQI = False And OCAR = False And VAIG = False And VECA = False And VEVO = False And PERS = False And DSEC = False And REMA = False And ANSI = False And CBA2 = False And DERA = False And MV = False And RATO = False And S = False And VEFE = False And AGSM = False And CHEX = False And FREP = False And JAMA = False And MATA = False And SECO = False And ICAB = False Then 'pas checkbox cochées
Sheets(Array("evenement conduite", "AVEN")).Select
Sheets(Array("evenement conduite", "AVEN")).Copy
Sheets("evenement conduite").Unprotect Password:="SoLeNe84"
Sheets("AVEN").Unprotect Password:="SoLeNe84"
Sheets(Array("evenement conduite", "AVEN")).Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
Sheets("evenement conduite").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="SoLeNe84"
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("AVEN").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("A1:AO150").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("evenement conduite").Select
Là, j'ai enlevé la suite car trop long ca va jusqu'à "evenement conduite", "AVEN"
End If
Set objSaveBox = Application.FileDialog(msoFileDialogSaveAs)
With objSaveBox
'Définit le type de fichier par défaut:
'(la valeur 4 Permet de spécifier les classeurs "Excel 97-2003" lorsque vous êtes dans Excel 2007)
.FilterIndex = 4
'Affiche la boîte de dialogue
.Show
'Enregistre
.Execute
End With
ActiveWindow.Close 'ferme le nouveau classeur
Unload UserForm20
Sheets("accueil").Select
Application.ScreenUpdating = True
CommandButton702
End Sub
Sub CommandButton702()
Application.ScreenUpdating = False
Dim objSaveBox As FileDialog
Dim sh As Shape
ElseIf EVCD = True And ANOT = True And ARPI = True And ATRA = True And AVEN = True And CBA = True And C = True And MAIL = True And MEQI = True And OCAR = True And VAIG = True And VECA = True And VEVO = True And PERS = True And DSEC = True And REMA = True And ANSI = True And CBA2 = True And DERA = True And MV = True And RATO = True And S = True And VEFE = True And AGSM = True And CHEX = True And FREP = True And JAMA = True And MATA = True And SECO = True And ICAB = True Then 'pas checkbox cochées
Sheets(Array("evenement conduite", "ANOT", "ARPI", "ATRA", "AVEN", "CBA", "C", "MAIL", "MEQI", "OCAR", "VAIG", "VECA", "VEVO", "PERS", "DSEC", "REMA", "ANSI", "CBA2", "DERA", "MV", "RATO", "S", "VEFE", "AGSM", "CHEX", "FREP", "JAMA", "MATA", "SECO", "ICAB")).Select
Sheets(Array("evenement conduite", "ANOT", "ARPI", "ATRA", "AVEN", "CBA", "C", "MAIL", "MEQI", "OCAR", "VAIG", "VECA", "VEVO", "PERS", "DSEC", "REMA", "ANSI", "CBA2", "DERA", "MV", "RATO", "S", "VEFE", "AGSM", "CHEX", "FREP", "JAMA", "MATA", "SECO", "ICAB")).Copy
Sheets("evenement conduite").Unprotect Password:="SoLeNe84"
Sheets("ANOT").Unprotect Password:="SoLeNe84"
Sheets("ARPI").Unprotect Password:="SoLeNe84"
Sheets("ATRA").Unprotect Password:="SoLeNe84"
Sheets("AVEN").Unprotect Password:="SoLeNe84"
Sheets("CBA").Unprotect Password:="SoLeNe84"
Sheets("C").Unprotect Password:="SoLeNe84"
Sheets("MAIL").Unprotect Password:="SoLeNe84"
Sheets("MEQI").Unprotect Password:="SoLeNe84"
Sheets("OCAR").Unprotect Password:="SoLeNe84"
Sheets("VAIG").Unprotect Password:="SoLeNe84"
Sheets("VECA").Unprotect Password:="SoLeNe84"
Sheets("VEVO").Unprotect Password:="SoLeNe84"
Sheets("PERS").Unprotect Password:="SoLeNe84"
Sheets("DSEC").Unprotect Password:="SoLeNe84"
Sheets("REMA").Unprotect Password:="SoLeNe84"
Sheets("ANSI").Unprotect Password:="SoLeNe84"
Sheets("CBA2").Unprotect Password:="SoLeNe84"
Sheets("DERA").Unprotect Password:="SoLeNe84"
Sheets("CBA").Unprotect Password:="SoLeNe84"
Sheets("MV").Unprotect Password:="SoLeNe84"
Sheets("RATO").Unprotect Password:="SoLeNe84"
Sheets("S").Unprotect Password:="SoLeNe84"
Sheets("VEFE").Unprotect Password:="SoLeNe84"
Sheets("AGSM").Unprotect Password:="SoLeNe84"
Sheets("CHEX").Unprotect Password:="SoLeNe84"
Sheets("FREP").Unprotect Password:="SoLeNe84"
Sheets("JAMA").Unprotect Password:="SoLeNe84"
Sheets("MATA").Unprotect Password:="SoLeNe84"
Sheets("SECO").Unprotect Password:="SoLeNe84"
Sheets("ICAB").Unprotect Password:="SoLeNe84"
Sheets(Array("evenement conduite", "ANOT", "ARPI", "ATRA", "AVEN", "CBA", "C", "MAIL", "MEQI", "OCAR", "VAIG", "VECA", "VEVO", "PERS", "DSEC", "REMA", "ANSI", "CBA2", "DERA", "MV", "RATO", "S", "VEFE", "AGSM", "CHEX", "FREP", "JAMA", "MATA", "SECO", "ICAB")).Select
Cells.Copy
Cells.PasteSpecial xlPasteValues ' on fait un copier-coller valeur pour supprimer les formules, et donc les liaisons
Range("A1").Select
Sheets("evenement conduite").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("C20:AO50").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
Sheets("ANOT").Select
For Each sh In ActiveSheet.Shapes
If Not sh.Name Like "cible" And Not sh.Name Like "logo" Then sh.Delete
Next sh
Range("C20:AO50").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="SoLeNe84", DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
ActiveWindow.SmallScroll Down:=-135
End If
Set objSaveBox = Application.FileDialog(msoFileDialogSaveAs)
With objSaveBox
'Définit le type de fichier par défaut:
'(la valeur 4 Permet de spécifier les classeurs "Excel 97-2003" lorsque vous êtes dans Excel 2007)
.FilterIndex = 4
'Affiche la boîte de dialogue
.Show
'Enregistre
.Execute
End With
ActiveWindow.Close 'ferme le nouveau classeur
Unload UserForm20
Sheets("accueil").Select
Application.ScreenUpdating = True
End Sub |
Partager