1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub testconvert()
Dim rng1 As Range
Set rng1 = Range("C6:C20")
MsgBox convertione(rng1)
End Sub
Public Function convertione(rng As Range)
Dim code
For i = rng.Row To rng.Cells(rng.Cells.Count).Row
t = Split(rng.Parent.Cells(i, "C").Value(xlRangeValueXMLSpreadsheet), "Table")(1)
t = Replace(t, "ss:", "")
Debug.Print t
t = Split(Split(t, "<Cell")(1), "</Cell")(0)
If t Like "*=""String"">*" Then
t = Split(t, "=""String"">")(1)
ElseIf t Like "*-html40"">*" Then t = Split(t, "-html40"">")(1)
Else
t = " "
End If
t = "<P>" & t & "</P>"
t = Replace(Replace(t, "</Data>", ""), "html:", "")
code = code & vbCrLf & t
Next
convertione = code
End Function |
Partager