Option Explicit
Option Base 1
Sub SuppressionLignes()
Dim objCol As New Collection
Dim x As Integer, i As Integer
Dim strLigne As String, Fichier As String
Dim Tableau As Variant
'Définit les lignes à supprimer, par
'ordre décroissant impérativement !
Tableau = Array(2, 1)
Fichier = "C:\dossier\monFichier.txt"
x = FreeFile
'Transfère des infos du fichier txt vers une collection.
Open Fichier For Input As #x
While Not EOF(x)
Line Input #x, strLigne
objCol.Add strLigne
Wend
Close #x
'Suppression des lignes spécifiées dans la collection.
For i = 1 To UBound(Tableau)
If objCol.Count > Tableau(i) Then _
objCol.Remove Tableau(i)
Next i
'Transfère la collection vers le fichier txt.
Open Fichier For Output As #x
For i = 1 To objCol.Count
Print #x, objCol(i)
Next
Close #x
End Sub