Please use code tags when posting codes.
Quote:
so I don't want to use range and move from cell to cell because it ignores the other sentences.
|
No, you DO want to use range, because it does NOT ignore other sentences.
Code:
Sub AsterisksBold()
Dim r As Range
Dim SentenceRange As Range
Set r = Selection.Range.Cells(1).Range
For Each SentenceRange In r.Sentences
If SentenceRange.Font.Bold = True Then
SentenceRange.InsertBefore "**"
End If
Next
End Sub
Assuming of course you really do mean sentences, not paragraphs.
Oh, and the above REQUIRES that the selection is in the cells that you want to act. It will fail if the selection is not in a table. Best practice would actually test to make sure it IS in a table first. I did not bother...you should do it though.