Re : Instalation de UserForm dans mon fichier
Bonjour à tous,
Lundi matin retour au bureau 🙁
Mercant, jai regardé ton fichier le code ppour ajouter un salarié marche NIQUEL c'est exactement ce que je voulais!!!! Par contre, le code pour archiver a un pb, VBA me surligne cela :
Selection.Sort Key1:=Range("L3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Qu'en penses tu?
JP merci vraiment de te préoccuper de mon cas quelque peu ... complexe et un peu chiant! mais j'ai de nouveau un pb : un message "erreur de compilation..."
' Module : UserForm1/UserForm_Initialize
' DateTime : 02/02/2008 / 20:48
' Auteur : JP14
' Utilisation :initialisation de l'userform
'-------------------------------------------------------------------------------------
Private Sub UserForm_Initialize()
Dim pos1 As Integer
flag = True ' pour empécher le lancement des controles
'ligne2 = 3
With ComboBox1
.AddItem "M."
.AddItem "Mme"
.AddItem "Melle"
.AddItem "M. ou Mme"
End With
OptionButtonn9.Value = True
OptionButtonn10.Value = True
Call remplircombo("Base", "e", 5)
DTPicker7.Value = Now
Select Case ligne2
Case 0 ' création
Label1.Caption = "Vous souhaitez ajouter un salarié, veuillez remplir les données suivantes:"
UserForm1.Caption = "Création d'un salarié"
TextBox8.Visible = False
Label11.Visible = False
Label16.Visible = False
Case Else 'modification
dl1 = ligne2
With Sheets("Base")
UserForm1.Caption = "Modification d'un salarié"
ComboBox1.Value = .Range("a" & dl1)
TextBox2.Value = .Range("b" & dl1)
TextBox3.Value = .Range("c" & dl1)
If .Range("d" & dl1) <> "" Then
For i = 1 To Len(.Range("d" & dl1))
If i < 14 Then TextBox4.Value = TextBox4.Value & Mid(.Range("d" & dl1), i, 1)
Next i
If Len(.Range("d" & dl1)) > 13 Then TextBoxcle4.Value = Mid(.Range("d" & dl1), 14, 2)
End If
ComboBox5.Value = .Range("e" & dl1)
TextBox6.Value = .Range("f" & dl1)
DTPicker7.Value = .Range("g" & dl1)
If .Range("i" & dl1) = "Oui" Then
TextBox8.Visible = True
Label11.Visible = True
TextBox8.Value = .Range("h" & dl1)
OptionButtono9.Value = True
Else
TextBox8.Visible = False
Label11.Visible = False
End If
If .Range("j" & dl1) = True Then
OptionButtono10.Value = True
End If
If .Range("k" & dl1) <> "" Then
pos1 = InStr(1, .Range("k" & dl1), "@")
If pos1 > 0 Then
TextBox11.Value = Mid(.Range("k" & dl1), 1, pos1 - 1)
TextBoxa11.Value = Mid(.Range("k" & dl1), pos1 + 1, 100)
End If
End If
End With
End Select
flag = False
End Sub