Sub HTMLGen()' On calcule le nombre de valeurs en colonne A
Sheets("CSV").Select
Range("A1").Select
With Application.WorksheetFunction
nbligne = .CountA(Range("A:A"))
End With
MsgBox nbligne & " pages HTML vont être créées."
' La variable x va successivement prendre les valeurs de 1 à nbligne
Dim x As Integer
chemin = "D:\"
For x = 1 To nbligne
Set ados = CreateObject("ADODB.Stream")
With ados
.Open
.Position = 0
.Charset = "UTF-8"
.WriteText Cells(x + 1, 8), 1
.SaveToFile chemin & Cells(x + 1, 1) & ".html"
.Close
End With
Set ados = Nothing
Next x
End Sub