O.k. figured it out. Wow, it had nothing to do with Excel in this case. I found that this hack (or perhaps vBulletin) handles certain BB codes differently. For instance, if [center] is the primary modifier to a cell (the outside modifier) in addition to other codes, this hack goes haywire even though VISIBLY the code appears to be correct.
For instance:
[ center ] [ b ] TEST [ /b ] [ /center ] causes this hack grief.
Making the alignment tags the innermost modifiers fixes it:
[ b ] [ center ] TEST [ /center ] [ /b ]
I just moved the alignment tag adds to the beginning of the loop - I would suggest it's a problem you may run into too Bruno since it appears vBulletin is doing the rendering funny business.
Code:
For Each rngCell In rngRow.Cells
c = c + 1
sCell = rngCell.Text
sFont = rngCell.Font.Name
'If cell text is right aligned, add the [right] tag
If rngCell.HorizontalAlignment = xlRight Then
sCell ...
End If
'If cell text is centered, add the [center] tag
If rngCell.HorizontalAlignment = xlCenter Then
sCell = ...
End If
Fix attached: