Hi everyone,
Hope you've all had a wonderful weekend.
I have received 250 cells which I need to format into HTML for the system I use on my computer for work. Each line/paragraph needs to start with <p> and close with a </p>, however the below macro I have tried using is putting <p></p> in between each paragraph in the space sections. I need this to be gone as the system we use won't accept empty <p></p> lines.
Is anyone able to assist or fix the below please? Would be much appreciated. Will attach an image of how it looks and the macro I am using.
Hope you've all had a wonderful weekend.
I have received 250 cells which I need to format into HTML for the system I use on my computer for work. Each line/paragraph needs to start with <p> and close with a </p>, however the below macro I have tried using is putting <p></p> in between each paragraph in the space sections. I need this to be gone as the system we use won't accept empty <p></p> lines.
Is anyone able to assist or fix the below please? Would be much appreciated. Will attach an image of how it looks and the macro I am using.
Code:
Sub aTest()
Dim rCell As Range, spl As Variant, i As Long
For Each rCell In Selection
spl = Split(rCell, Chr(10))
For i = LBound(spl) To UBound(spl)
spl(i) = Chr(60) & "p" & Chr(62) & spl(i) & Chr(60) & "/p" & Chr(62)
Next i
rCell = Join(spl, Chr(10))
Next rCell
Selection.ColumnWidth = 200
Selection.EntireRow.AutoFit
Selection.EntireColumn.AutoFit
End Sub