Comment puis-je faire pour utiliser la petite croix rouge en haut =E0
droite d'un userform ?
Je voudrais lui dire de quitter ma macro si jamais on clique dessus.
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Daniel.C
Bonjour. Utilise l'évènement : UserForm_Terminate Cordialement. Daniel "Nyck0las" a écrit dans le message de news:
Bonjour,
Comment puis-je faire pour utiliser la petite croix rouge en haut à droite d'un userform ? Je voudrais lui dire de quitter ma macro si jamais on clique dessus.
merci
Bonjour.
Utilise l'évènement :
UserForm_Terminate
Cordialement.
Daniel
"Nyck0las" <nicolasnr62@gmail.com> a écrit dans le message de news:
861d5211-8137-4342-b990-37c69f6e24e3@x41g2000hsb.googlegroups.com...
Bonjour,
Comment puis-je faire pour utiliser la petite croix rouge en haut à
droite d'un userform ?
Je voudrais lui dire de quitter ma macro si jamais on clique dessus.
Bonjour. Utilise l'évènement : UserForm_Terminate Cordialement. Daniel "Nyck0las" a écrit dans le message de news:
Bonjour,
Comment puis-je faire pour utiliser la petite croix rouge en haut à droite d'un userform ? Je voudrais lui dire de quitter ma macro si jamais on clique dessus.
merci
Nyck0las
çà marche pas :-(
la macro s'arrete alors que je n'ai pas cliqué sur fermer ...
çà marche pas :-(
la macro s'arrete alors que je n'ai pas cliqué sur fermer ...
la macro s'arrete alors que je n'ai pas cliqué sur fermer ...
Daniel.C
Pas compris. Poste ton code. Daniel "Nyck0las" a écrit dans le message de news:
çà marche pas :-(
la macro s'arrete alors que je n'ai pas cliqué sur fermer ...
Pas compris. Poste ton code.
Daniel
"Nyck0las" <nicolasnr62@gmail.com> a écrit dans le message de news:
dea78905-61d5-408b-9828-cdfb9beecbcd@n58g2000hsf.googlegroups.com...
çà marche pas :-(
la macro s'arrete alors que je n'ai pas cliqué sur fermer ...
Pas compris. Poste ton code. Daniel "Nyck0las" a écrit dans le message de news:
çà marche pas :-(
la macro s'arrete alors que je n'ai pas cliqué sur fermer ...
Nyck0las
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct Pourcent.Locked = True
Seuil = SCpl Seuil.Locked = True
With Spin_P .min = 0 .Max = 100 .SmallChange = 1 End With
With Spin_S .min = 0 .Max = 100 .SmallChange = 1 End With
End Sub
Private Sub Spin_P_Change() Pourcent = Spin_P.Value End Sub
Private Sub Spin_S_Change() Seuil = Spin_S.Value End Sub
Private Sub Pourcent_Change() Dim NewVal As Integer NewVal = val(Pourcent.Text) If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value = NewVal End Sub
Private Sub Seuil_Change() Dim NewVal As Integer NewVal = val(Seuil.Text) If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value = NewVal End Sub
Private Sub OK_Click() Unload ChxParam Pct = val(Pourcent.Text) SCpl = val(Seuil.Text) If Rd_OD = True Then Mode_Reduc = "On demand" ElseIf Rd_A = True Then Mode_Reduc = "Auto" ElseIf Rd_N = True Then Mode_Reduc = "None" End If End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite croix rouge de l'userform, je quitte la macro toute entière. Ce qui reviendrait à un truc du type :
Private Sub Croix_Rouge_Click() End End Sub
or si je mets un truc de ce type :
Private Sub UserForm_Terminate() end End Sub
même quand je clique sur ok, tout s'arrete
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct
Pourcent.Locked = True
Seuil = SCpl
Seuil.Locked = True
With Spin_P
.min = 0
.Max = 100
.SmallChange = 1
End With
With Spin_S
.min = 0
.Max = 100
.SmallChange = 1
End With
End Sub
Private Sub Spin_P_Change()
Pourcent = Spin_P.Value
End Sub
Private Sub Spin_S_Change()
Seuil = Spin_S.Value
End Sub
Private Sub Pourcent_Change()
Dim NewVal As Integer
NewVal = val(Pourcent.Text)
If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value
= NewVal
End Sub
Private Sub Seuil_Change()
Dim NewVal As Integer
NewVal = val(Seuil.Text)
If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value
= NewVal
End Sub
Private Sub OK_Click()
Unload ChxParam
Pct = val(Pourcent.Text)
SCpl = val(Seuil.Text)
If Rd_OD = True Then
Mode_Reduc = "On demand"
ElseIf Rd_A = True Then
Mode_Reduc = "Auto"
ElseIf Rd_N = True Then
Mode_Reduc = "None"
End If
End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite
croix rouge de l'userform, je quitte la macro toute entière.
Ce qui reviendrait à un truc du type :
With Spin_P .min = 0 .Max = 100 .SmallChange = 1 End With
With Spin_S .min = 0 .Max = 100 .SmallChange = 1 End With
End Sub
Private Sub Spin_P_Change() Pourcent = Spin_P.Value End Sub
Private Sub Spin_S_Change() Seuil = Spin_S.Value End Sub
Private Sub Pourcent_Change() Dim NewVal As Integer NewVal = val(Pourcent.Text) If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value = NewVal End Sub
Private Sub Seuil_Change() Dim NewVal As Integer NewVal = val(Seuil.Text) If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value = NewVal End Sub
Private Sub OK_Click() Unload ChxParam Pct = val(Pourcent.Text) SCpl = val(Seuil.Text) If Rd_OD = True Then Mode_Reduc = "On demand" ElseIf Rd_A = True Then Mode_Reduc = "Auto" ElseIf Rd_N = True Then Mode_Reduc = "None" End If End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite croix rouge de l'userform, je quitte la macro toute entière. Ce qui reviendrait à un truc du type :
Private Sub Croix_Rouge_Click() End End Sub
or si je mets un truc de ce type :
Private Sub UserForm_Terminate() end End Sub
même quand je clique sur ok, tout s'arrete
Daniel.C
Si ton userform s'appelle ChxParam, tu écris : Private Sub userForm_Initialize() teste=0 ...
Private Sub Croix_Rouge_Click() teste=1 End Sub Private Sub OK_Click() if teste=1 then end else .... end if Daniel "Nyck0las" a écrit dans le message de news:
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct Pourcent.Locked = True
Seuil = SCpl Seuil.Locked = True
With Spin_P .min = 0 .Max = 100 .SmallChange = 1 End With
With Spin_S .min = 0 .Max = 100 .SmallChange = 1 End With
End Sub
Private Sub Spin_P_Change() Pourcent = Spin_P.Value End Sub
Private Sub Spin_S_Change() Seuil = Spin_S.Value End Sub
Private Sub Pourcent_Change() Dim NewVal As Integer NewVal = val(Pourcent.Text) If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value = NewVal End Sub
Private Sub Seuil_Change() Dim NewVal As Integer NewVal = val(Seuil.Text) If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value = NewVal End Sub
Private Sub OK_Click() Unload ChxParam Pct = val(Pourcent.Text) SCpl = val(Seuil.Text) If Rd_OD = True Then Mode_Reduc = "On demand" ElseIf Rd_A = True Then Mode_Reduc = "Auto" ElseIf Rd_N = True Then Mode_Reduc = "None" End If End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite croix rouge de l'userform, je quitte la macro toute entière. Ce qui reviendrait à un truc du type :
Private Sub Croix_Rouge_Click() End End Sub
or si je mets un truc de ce type :
Private Sub UserForm_Terminate() end End Sub
même quand je clique sur ok, tout s'arrete
Si ton userform s'appelle ChxParam,
tu écris :
Private Sub userForm_Initialize()
teste=0
...
Private Sub Croix_Rouge_Click()
teste=1
End Sub
Private Sub OK_Click()
if teste=1 then
end
else
....
end if
Daniel
"Nyck0las" <nicolasnr62@gmail.com> a écrit dans le message de news:
d3ce835f-75ef-4307-942a-c566cf5ea7a8@v3g2000hsc.googlegroups.com...
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct
Pourcent.Locked = True
Seuil = SCpl
Seuil.Locked = True
With Spin_P
.min = 0
.Max = 100
.SmallChange = 1
End With
With Spin_S
.min = 0
.Max = 100
.SmallChange = 1
End With
End Sub
Private Sub Spin_P_Change()
Pourcent = Spin_P.Value
End Sub
Private Sub Spin_S_Change()
Seuil = Spin_S.Value
End Sub
Private Sub Pourcent_Change()
Dim NewVal As Integer
NewVal = val(Pourcent.Text)
If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value
= NewVal
End Sub
Private Sub Seuil_Change()
Dim NewVal As Integer
NewVal = val(Seuil.Text)
If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value
= NewVal
End Sub
Private Sub OK_Click()
Unload ChxParam
Pct = val(Pourcent.Text)
SCpl = val(Seuil.Text)
If Rd_OD = True Then
Mode_Reduc = "On demand"
ElseIf Rd_A = True Then
Mode_Reduc = "Auto"
ElseIf Rd_N = True Then
Mode_Reduc = "None"
End If
End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite
croix rouge de l'userform, je quitte la macro toute entière.
Ce qui reviendrait à un truc du type :
Si ton userform s'appelle ChxParam, tu écris : Private Sub userForm_Initialize() teste=0 ...
Private Sub Croix_Rouge_Click() teste=1 End Sub Private Sub OK_Click() if teste=1 then end else .... end if Daniel "Nyck0las" a écrit dans le message de news:
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct Pourcent.Locked = True
Seuil = SCpl Seuil.Locked = True
With Spin_P .min = 0 .Max = 100 .SmallChange = 1 End With
With Spin_S .min = 0 .Max = 100 .SmallChange = 1 End With
End Sub
Private Sub Spin_P_Change() Pourcent = Spin_P.Value End Sub
Private Sub Spin_S_Change() Seuil = Spin_S.Value End Sub
Private Sub Pourcent_Change() Dim NewVal As Integer NewVal = val(Pourcent.Text) If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value = NewVal End Sub
Private Sub Seuil_Change() Dim NewVal As Integer NewVal = val(Seuil.Text) If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value = NewVal End Sub
Private Sub OK_Click() Unload ChxParam Pct = val(Pourcent.Text) SCpl = val(Seuil.Text) If Rd_OD = True Then Mode_Reduc = "On demand" ElseIf Rd_A = True Then Mode_Reduc = "Auto" ElseIf Rd_N = True Then Mode_Reduc = "None" End If End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite croix rouge de l'userform, je quitte la macro toute entière. Ce qui reviendrait à un truc du type :
Private Sub Croix_Rouge_Click() End End Sub
or si je mets un truc de ce type :
Private Sub UserForm_Terminate() end End Sub
même quand je clique sur ok, tout s'arrete
Daniel.C
Faut affiner. Dans un module : Public teste Private Sub userForm_Initialize() teste=0 ... Private Sub Userform_Terminate() if teste = 0 then end End Sub Private Sub OK_Click() teste = 1 ... Daniel "Daniel.C" a écrit dans le message de news: %
Si ton userform s'appelle ChxParam, tu écris : Private Sub userForm_Initialize() teste=0 ...
Private Sub Croix_Rouge_Click() teste=1 End Sub Private Sub OK_Click() if teste=1 then end else .... end if Daniel "Nyck0las" a écrit dans le message de news:
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct Pourcent.Locked = True
Seuil = SCpl Seuil.Locked = True
With Spin_P .min = 0 .Max = 100 .SmallChange = 1 End With
With Spin_S .min = 0 .Max = 100 .SmallChange = 1 End With
End Sub
Private Sub Spin_P_Change() Pourcent = Spin_P.Value End Sub
Private Sub Spin_S_Change() Seuil = Spin_S.Value End Sub
Private Sub Pourcent_Change() Dim NewVal As Integer NewVal = val(Pourcent.Text) If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value = NewVal End Sub
Private Sub Seuil_Change() Dim NewVal As Integer NewVal = val(Seuil.Text) If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value = NewVal End Sub
Private Sub OK_Click() Unload ChxParam Pct = val(Pourcent.Text) SCpl = val(Seuil.Text) If Rd_OD = True Then Mode_Reduc = "On demand" ElseIf Rd_A = True Then Mode_Reduc = "Auto" ElseIf Rd_N = True Then Mode_Reduc = "None" End If End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite croix rouge de l'userform, je quitte la macro toute entière. Ce qui reviendrait à un truc du type :
Private Sub Croix_Rouge_Click() End End Sub
or si je mets un truc de ce type :
Private Sub UserForm_Terminate() end End Sub
même quand je clique sur ok, tout s'arrete
Faut affiner.
Dans un module :
Public teste
Private Sub userForm_Initialize()
teste=0
...
Private Sub Userform_Terminate()
if teste = 0 then end
End Sub
Private Sub OK_Click()
teste = 1
...
Daniel
"Daniel.C" <dZZZcolardelle@free.fr> a écrit dans le message de news:
%23sPoYO5gIHA.5752@TK2MSFTNGP03.phx.gbl...
Si ton userform s'appelle ChxParam,
tu écris :
Private Sub userForm_Initialize()
teste=0
...
Private Sub Croix_Rouge_Click()
teste=1
End Sub
Private Sub OK_Click()
if teste=1 then
end
else
....
end if
Daniel
"Nyck0las" <nicolasnr62@gmail.com> a écrit dans le message de news:
d3ce835f-75ef-4307-942a-c566cf5ea7a8@v3g2000hsc.googlegroups.com...
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct
Pourcent.Locked = True
Seuil = SCpl
Seuil.Locked = True
With Spin_P
.min = 0
.Max = 100
.SmallChange = 1
End With
With Spin_S
.min = 0
.Max = 100
.SmallChange = 1
End With
End Sub
Private Sub Spin_P_Change()
Pourcent = Spin_P.Value
End Sub
Private Sub Spin_S_Change()
Seuil = Spin_S.Value
End Sub
Private Sub Pourcent_Change()
Dim NewVal As Integer
NewVal = val(Pourcent.Text)
If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value
= NewVal
End Sub
Private Sub Seuil_Change()
Dim NewVal As Integer
NewVal = val(Seuil.Text)
If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value
= NewVal
End Sub
Private Sub OK_Click()
Unload ChxParam
Pct = val(Pourcent.Text)
SCpl = val(Seuil.Text)
If Rd_OD = True Then
Mode_Reduc = "On demand"
ElseIf Rd_A = True Then
Mode_Reduc = "Auto"
ElseIf Rd_N = True Then
Mode_Reduc = "None"
End If
End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite
croix rouge de l'userform, je quitte la macro toute entière.
Ce qui reviendrait à un truc du type :
Faut affiner. Dans un module : Public teste Private Sub userForm_Initialize() teste=0 ... Private Sub Userform_Terminate() if teste = 0 then end End Sub Private Sub OK_Click() teste = 1 ... Daniel "Daniel.C" a écrit dans le message de news: %
Si ton userform s'appelle ChxParam, tu écris : Private Sub userForm_Initialize() teste=0 ...
Private Sub Croix_Rouge_Click() teste=1 End Sub Private Sub OK_Click() if teste=1 then end else .... end if Daniel "Nyck0las" a écrit dans le message de news:
voici un des userform que j'utilise :
Private Sub userForm_Initialize()
Rd_OD = True
Pourcent = Pct Pourcent.Locked = True
Seuil = SCpl Seuil.Locked = True
With Spin_P .min = 0 .Max = 100 .SmallChange = 1 End With
With Spin_S .min = 0 .Max = 100 .SmallChange = 1 End With
End Sub
Private Sub Spin_P_Change() Pourcent = Spin_P.Value End Sub
Private Sub Spin_S_Change() Seuil = Spin_S.Value End Sub
Private Sub Pourcent_Change() Dim NewVal As Integer NewVal = val(Pourcent.Text) If NewVal >= Spin_P.min And NewVal <= Spin_P.Max Then Spin_P.Value = NewVal End Sub
Private Sub Seuil_Change() Dim NewVal As Integer NewVal = val(Seuil.Text) If NewVal >= Spin_S.min And NewVal <= Spin_S.Max Then Spin_S.Value = NewVal End Sub
Private Sub OK_Click() Unload ChxParam Pct = val(Pourcent.Text) SCpl = val(Seuil.Text) If Rd_OD = True Then Mode_Reduc = "On demand" ElseIf Rd_A = True Then Mode_Reduc = "Auto" ElseIf Rd_N = True Then Mode_Reduc = "None" End If End Sub
Ce que je souhaiterais, c'est que lorsque je clique sur la petite croix rouge de l'userform, je quitte la macro toute entière. Ce qui reviendrait à un truc du type :