O
omsoft
I have several thousand rows of Excel data - text with various HTML tags
embedded within. The text size (cell length) is several thousand characters.
I am trying to replace these tags with Excel-style formatting. For example
make it <b>bold</b> to make it bold for partial string.
I read each character, distinguish tags e.g. <b> or </b>. note the start and
end position of bold and unbold. and then use the following code. sPos and
ePos are getting set correctly, but the string does not get bolded. Below is
the code I am using. j is the subscript in the for loop to go thru each
character.
If strTag = "</B>" And sPos > 0 Then
ePos = j - 1
With ActiveCell.Characters(sPos, ePos - sPos + 1).Font
.FontStyle = "Bold"
End With
startTag = False
endTag = False
sPos = 0
isBold = False
End If
Any help will be great.
Thanks.
embedded within. The text size (cell length) is several thousand characters.
I am trying to replace these tags with Excel-style formatting. For example
make it <b>bold</b> to make it bold for partial string.
I read each character, distinguish tags e.g. <b> or </b>. note the start and
end position of bold and unbold. and then use the following code. sPos and
ePos are getting set correctly, but the string does not get bolded. Below is
the code I am using. j is the subscript in the for loop to go thru each
character.
If strTag = "</B>" And sPos > 0 Then
ePos = j - 1
With ActiveCell.Characters(sPos, ePos - sPos + 1).Font
.FontStyle = "Bold"
End With
startTag = False
endTag = False
sPos = 0
isBold = False
End If
Any help will be great.
Thanks.