L
Léon de Marseille
Guest
Bonjour à tous
J'ai un plantage dans un userform, surement très évident pour vous,
Private Sub CommandButton1_Click() 'bouton 'Ok'
Dim Dl As Long 'déclare la variable Dl (Dernière ligne)
Dim x As Byte 'déclare la variable x
With Sheets('Feuil2')
.Activate 'active l'onglet 'Feuil2'
Dl = .Range('A65536').End(xlUp).Row + 1 'définit la variable Dl
'place les donnés dans le tableau
For x = 1 To 19 'boucle sur 19 éléments
.Cells(Dl, x).Value = Me.Controls('TextBox' & x).Value
Next x
Unload Me 'vide et ferme l'UserFOrm
'tri selon le nom
.Range('A1').CurrentRegion.Sort Key1:=Range('A1'), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Sub
Ci joint fichier Merci d'avance
Léon
[file name=Isabelle.zip size=19520]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/Isabelle.zip[/file]
J'ai un plantage dans un userform, surement très évident pour vous,
Private Sub CommandButton1_Click() 'bouton 'Ok'
Dim Dl As Long 'déclare la variable Dl (Dernière ligne)
Dim x As Byte 'déclare la variable x
With Sheets('Feuil2')
.Activate 'active l'onglet 'Feuil2'
Dl = .Range('A65536').End(xlUp).Row + 1 'définit la variable Dl
'place les donnés dans le tableau
For x = 1 To 19 'boucle sur 19 éléments
.Cells(Dl, x).Value = Me.Controls('TextBox' & x).Value
Next x
Unload Me 'vide et ferme l'UserFOrm
'tri selon le nom
.Range('A1').CurrentRegion.Sort Key1:=Range('A1'), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Sub
Ci joint fichier Merci d'avance
Léon
[file name=Isabelle.zip size=19520]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/Isabelle.zip[/file]