Attribute VB_Name = "ModImporterCSV6" Option Explicit Public Sub CreerImportCSVPopulation() Dim ws As Worksheet Set ws = ResetSheetIDR("IMPORT_CSV_SALARIES") EcrireEntetesImportCSV ws FormatReferentielIDR ws, "A1:Q1" MsgBox "IMPORT_CSV_SALARIES cree.", vbInformation End Sub Private Sub EcrireEntetesImportCSV(ByVal ws As Worksheet) ws.Cells(1, 1).value = "Matricule" ws.Cells(1, 2).value = "Nom" ws.Cells(1, 3).value = "Prenom" ws.Cells(1, 4).value = "Sexe" ws.Cells(1, 5).value = "CSP" ws.Cells(1, 6).value = "Accord_Entreprise" ws.Cells(1, 7).value = "Date_Naissance" ws.Cells(1, 8).value = "Date_Entree" ws.Cells(1, 9).value = "Date_Sortie" ws.Cells(1, 10).value = "Statut" ws.Cells(1, 11).value = "Convention" ws.Cells(1, 12).value = "Etablissement" ws.Cells(1, 13).value = "Salaire_Brut_Mensuel" ws.Cells(1, 14).value = "Remuneration_12_Mois" ws.Cells(1, 15).value = "Remuneration_3_Mois" ws.Cells(1, 16).value = "Primes_Annuelles" ws.Cells(1, 17).value = "Temps_Travail" End Sub Public Sub ImporterCSVPopulation() Dim ws As Worksheet Dim fichierCSV As Variant Dim qt As QueryTable If Not SheetExistsIDR("IMPORT_CSV_SALARIES") Then CreerImportCSVPopulation End If Set ws = Worksheets("IMPORT_CSV_SALARIES") ws.Cells.Clear fichierCSV = Application.GetOpenFilename("Fichiers CSV (*.csv),*.csv") If fichierCSV = False Then Exit Sub Set qt = ws.QueryTables.Add(Connection:="TEXT;" & fichierCSV, Destination:=ws.Range("A1")) With qt .TextFileParseType = xlDelimited .TextFileSemicolonDelimiter = True .TextFileCommaDelimiter = False .TextFilePlatform = 65001 .AdjustColumnWidth = True .Refresh BackgroundQuery:=False End With ws.Columns.AutoFit MsgBox "Import CSV termine.", vbInformation End Sub