Bonjour Isabelle, Brodyeva
Autre façon de produire le tableau que tu peux ensuite intégrer dans ton code
https://forum.excel-pratique.com/viewtopic.php?p=736964#p736964
Function tableauhtml(plage As Range) As String
Dim cel As Range
Set cel = plage.Cells(1, 1)
tableauhtml = "<table>"
For i = 1 To plage.Rows.Count
tableauhtml = tableauhtml & "<tr>"
For j = 1 To plage.Columns.Count
tableauhtml = tableauhtml & "<td>" & texthtml(cel.Offset(i - 1, j - 1).Value) & "</td>"
Next
tableauhtml = tableauhtml & "</tr>"
Next
tableauhtml = tableauhtml & "</table>"
End Function
Function texthtml(texte As String)
texthtml = ""
For i = 1 To Len(texte)
Select Case Asc(Mid(texte, i, 1))
Case Is = 10
texthtml = texthtml & "<br/>"
Case Is = 39
texthtml = texthtml & "&#" & Application.Trim(Str(Asc(Mid(texte, i, 1)))) & ";"
Case Is > 127
texthtml = texthtml & "&#" & Application.Trim(Str(Asc(Mid(texte, i, 1)))) & ";"
Case Else
texthtml = texthtml & Mid(texte, i, 1)
End Select
Next
End Function