Dim oFSO
Dim strChemin As String
Dim strCheminComp As String
Set oFSO = CreateObject("Scripting.FileSystemObject")
strChemin = ThisWorkbook.Path
strCheminComp = ThisWorkbook.FullName
dossier = oFSO.GetBaseName(strChemin)
Fichier = oFSO.GetBaseName(strCheminComp)
Dim stgOut1 As String
Dim stgOut2 As String
fich1 = "F:\outilswgsr"
Fich = fich1 & "\" & "resultats" & ".csv"
Open Fich For Output As #1
Do While Workbooks("" & Fichier & ".xls").Sheets("résultats").Cells(2, j).Value <> ""
stgOut1 = Sheets("résultats").Cells(2, j)
Do While Sheets("résultats").Cells(k, j) <> ""
stgOut1 = stgOut1 & ";" & Sheets("résultats").Cells(k, j)
k = k + 1
Loop
Print #1, (Trim(stgOut1))
j = j + 1
Loop
Close 1