Dan
-
19 juil. 2000 à 14:43
cs_EBArtSoft
Messages postés4525Date d'inscriptiondimanche 29 septembre 2002StatutModérateurDernière intervention22 avril 2019
-
30 juil. 2007 à 09:03
Je recherche vainement de l'aide sur une argumentation Visual Basic.
J'ai créé un formulaire qui devrai s'utiliser sur excel 97.
Ce formulaire comprend 4 choix:
- 3 options de tri (Tri croissant, Tri décroissant, Tri Alphabétique ). Ces 3 macros fonctionnent parfaitement.
- 1 options "Annuler" au cas ou l'utilisateur ne désir pas faire de Tri et désire revenir sur le tableau Excel. ( Cette option ne fonctionne pas du tout car mal formulée.
Comment faire pour que:
1°) Ce formulaire s'ouvre si dans une case, ( en l'occurrence ) la case C5 de ma feuille 1, le texte "TOUTES" est sélectionné (grâce à une liste déroulante)?
2°) Ce formulaire se ferme lorsque l'utilisateur clic sur l'option "Annuler" du formulaire.
Merci d'avance
Ci-dessous mes macros:
Private Sub btnAnnuler_Click()
Set formfrmOptionsdeTri = Nothing
Unload Me
End Sub
Private Sub optTriAlphabétique_Click()
ActiveWindow.LargeScroll ToRight:=5
Range("AV1:AY49").Select
Selection.Sort Key1:=Range("AV2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveWindow.LargeScroll ToRight:=-5
Range("A1").Select
End Sub
Private Sub optTriCroissant_Click()
ActiveWindow.LargeScroll ToRight:=5
Range("AV1:AY49").Select
Selection.Sort Key1:=Range("AX2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveWindow.LargeScroll ToRight:=-5
Range("A1").Select
End Sub
Private Sub optTriDécroissant_Click()
ActiveWindow.LargeScroll ToRight:=5
Range("AV1:AY49").Select
Selection.Sort Key1:=Range("AX2"), Order1:=xlDescending, Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveWindow.LargeScroll ToRight:=-5
Range("A1").Select
End Sub
Private Sub frmOptionsdeTri_Active()
If sheet("feuil1").Range("c5")= "TOUTES" Then
Openform frmOptionsdeTri
End If
End Sub