Bonjour,
Je cherche à extraire des données d'un tableau pour les écrire dans un fichier .csv.
Une ligne du fichier (ligne 3 dans cet exemple devra donc avoir cette allure :
A3;B3;C3;D3;...;O3;P3;Q3
J'ai pour l'instant tout codé en dur et j'aimerai trouver un moyen de le réduire à l'aide d'une boucle for par exemple.
Function line(i As Byte) As String 'création de la ligne pour le ficher .csv en fonction du numéro de ligne
Dim s As String
s = ";" 'définir le séparateur pour le .csv
line = Range("Tab!A" & i).Value & s & Range("Tab!B" & i).Value & s & Range("Tab!C" & i).Value & s & Range("Tab!D" & i).Value & s & Range("Tab!E" & i).Value & s & Range("Tab!F" & i).Value & s & Range("Tab!G" & i).Value & s & Range("Tab!H" & i).Value & s & Range("Tab!I" & i).Value & s & Range("Tab!J" & i).Value & s & Range("Tab!K" & i).Value & s & Range("Tab!L" & i).Value & s & Range("Tab!M" & i).Value & s & Range("Tab!N" & i).Value & s & Range("Tab!O" & i).Value & s & Range("Tab!P" & i).Value & s & Range("Tab!Q" & i).Value
End Function
Merci de votre aide!