Bonjour,
Voila en pièce jointe le fichier txt (avec un seul bloc d'information pour le test). et voici le code que j'ai suite à ta dernière réponse :
Sub aargh()
k = 1
Cells.ClearContents
Cells(1, 1).Resize(, 11) = Split("DistinguishedName,Enabled,GivenName,LastLogonDate,Name,ObjectClass,ObjectGUID,SamAccountName,SID,Surname,UserPrincipalName", ",")
Open "C:\Users\a.bruyere\Desktop\UsersList.txt" For Input As 1 'adapter le nom du fichier
While Not EOF(1)
Line Input #1, ligne
If ligne <> "" Then
t = Split(ligne, " : ")
If UCase(t(0)) = "DISTINGUISHEDNAME" Then k = k + 1
Set re = Rows(1).Find(t(0), lookat:=xlWhole)
If Not re Is Nothing Then
Cells(k, re.Column) = t(1)
End If
End If
Wend
Close 1
End Sub
Merci pour ton aide.