1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub EcrireTxt()
Dim Fs As Object, A As Object
Dim i As Long
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile("C:\Users\Documents\commentaire.txt", True)
With Sheets("Feuil1")
For i = 2 To .Cells(.Rows.Count, "A").End(xlUp).Row
A.WriteLine ("'--------------------------------------------------------------")
A.WriteLine ("'Nom Macro : " & .Range("A" & i).Value)
A.WriteLine ("'Appelée par : " & .Range("C" & i).Value)
A.WriteLine ("'Rôle : " & .Range("B" & i).Value)
A.WriteLine ("'--------------------------------------------------------------")
A.WriteLine (vbCrLf)
Next i
End With
A.Close
Set A = Nothing
Set Fs = Nothing
End Sub |
Partager