Sub Workbook_Open()

    Application.DisplayAlerts = False
   Application.CutCopyMode = False
   ' With ActiveSheet.QueryTables.Add(Connection:="TEXT;\\PCWSV001.belgianrail.be\FAZ01\B-TC.S_Public\AUTO_SAP_EXPORTS\Cuesmes\44ZHR_0002_55.txt", _
   '     Destination:=Range("$A$1"))
            With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\Users\ITD7200\Desktop\Nouveau dossier\phil\essai\44ZHR_0002_55.txt", _
        Destination:=Range("$A$1"))
        '.CommandType = 0
        .Name = "44ZHR_0002_55"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 1252
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileOtherDelimiter = "|"
        .TextFileColumnDataTypes = Array(1, 2, 2, 4, 4, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    Columns("A:B").Select
    Selection.Delete Shift:=xlToLeft
    Columns("B:C").Select
    Selection.Delete Shift:=xlToLeft
    Columns("D:D").Select
    Selection.Delete Shift:=xlToLeft
    Columns("F:BJ").Select
    Selection.Delete Shift:=xlToLeft
'-----------------------------------
Dim sel As Variant
Dim lig As Long
Set sel = Sheets("Feuil1").Range("c1:c65536").Find(What:="Vinck")
            If Not sel Is Nothing Then
                 lig = Sheets("Feuil1").Range("c1:c65536").Find(What:="Vinck").Row
                 Sheets("Feuil1").Cells(lig, 4).Value = "Peinture                                "
            End If
Set sel = Sheets("Feuil1").Range("c1:c65536").Find(What:="Lapoulle")
            If Not sel Is Nothing Then
                 lig = Sheets("Feuil1").Range("c1:c65536").Find(What:="Lapoulle").Row
                 Sheets("Feuil1").Cells(lig, 4).Value = "Habillage                               "
            End If
Set sel = Sheets("Feuil1").Range("c1:c65536").Find(What:="Glineur")
            If Not sel Is Nothing Then
                 lig = Sheets("Feuil1").Range("c1:c65536").Find(What:="Glineur").Row
                 Sheets("Feuil1").Cells(lig, 4).Value = "Chocs, traction & freins                "
            End If
Set sel = Sheets("Feuil1").Range("c1:c65536").Find(What:="Lenchant")
            If Not sel Is Nothing Then
                 lig = Sheets("Feuil1").Range("c1:c65536").Find(What:="Lenchant").Row
                 Sheets("Feuil1").Cells(lig, 4).Value = "Magasin                                 "
            End If
Set sel = Sheets("Feuil1").Range("c1:c65536").Find(What:="Renuart")
            If Not sel Is Nothing Then
                 lig = Sheets("Feuil1").Range("c1:c65536").Find(What:="Renuart").Row
                 Sheets("Feuil1").Cells(lig, 4).Value = "Etudes & méthodes                       "
            End If

'-----------------------------------

    ChDir "C:\Users\ITD7200\Desktop\Nouveau dossier\phil\essai"
 
    ActiveWorkbook.SaveAs Filename:="C:\Users\ITD7200\Desktop\Nouveau dossier\phil\essai\44ZHR_0002_55.txt", _
        FileFormat:=xlUnicodeText, CreateBackup:=False
Application.Quit
Application.DisplayAlerts = True


End Sub



