amelioration de code par un alias
bonjour à tous
dans le code ci dessous je choisis parmi une liste pour remplir une box (operation_box).
cette information me permet de sélectionné tout d'abord une macro avec le code ci dessous
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
If operation_box.Value = "parfum" Then parfum
If operation_box.Value = "parapharmacie" Then parapharmacie
If operation_box.Value = "bijou" Then bijou
If operation_box.Value = "cartouche" Then cartouche
If operation_box.Value = "livre" Then livre
If operation_box.Value = "farine" Then farine
If operation_box.Value = "cosmetique" Then cosmetique
If operation_box.Value = "consommable" Then consommable
If operation_box.Value = "garantie" Then garantie
If operation_box.Value = "photo" Then photo
If operation_box.Value = "ustensille" Then ustensille
If operation_box.Value = "vin" Then vin |
et par la suite de remplir certaine feuille bien précise (feuille qui sont masqué)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Sheets("parfum").Visible = True
Sheets("bijou").Visible = True
Sheets("farine").Visible = True
Sheets("cartouche").Visible = True
Sheets("livre").Visible = True
Sheets("parapharmacie").Visible = True
Sheets("cosmetique").Visible = True
Sheets("consommable").Visible = True
Sheets("photo").Visible = True
Sheets("ustensille").Visible = True
Sheets("vin").Visible = True
If operation_box.Value = "parfum" Then Sheets("parfum").Select
If operation_box.Value = "bijou" Then Sheets("bijou").Select
If operation_box.Value = "farine" Then Sheets("farine").Select
If operation_box.Value = "cartouche" Then Sheets("cartouche").Select
If operation_box.Value = "livre" Then Sheets("livre").Select
If operation_box.Value = "parapharmacie" Then Sheets("parapharmacie").Select
If operation_box.Value = "cosmetique" Then Sheets("cosmetique").Select
If operation_box.Value = "consommable" Then Sheets("consommable").Select
If operation_box.Value = "garantie" Then Sheets("garantie").Select
If operation_box.Value = "photo" Then Sheets("photo").Select
If operation_box.Value = "ustensille" Then Sheets("ustensille").Select
If operation_box.Value = "vin" Then Sheets("vin").Select |
est-il possible d'améliorer ce code grâce à un alias ou une autre technique ?