PDA

View Full Version : Red Suit Symbols Macro



altaynz
03-07-2018, 04:42 PM
I need to create a macro so that I can insert a heart of diamond symbol, have it appear in red but have the next character revert to black. I did solve this problem some years ago but my old computer died taking the macro with it. I can't forth life of me remember how I did it. Any help?

gmayor
03-08-2018, 01:03 AM
The following should do th trick


Sub Diamond()
Dim oRng As Range
Set oRng = Selection.Range
With oRng
.Collapse 0
.InsertSymbol _
Font:="Symbol", _
CharacterNumber:=-3928, _
Unicode:=True 'for hearts character number 3297
.Characters(1).Font.ColorIndex = wdRed
.MoveEnd wdCharacter, 1
.Collapse 0
.Text = Chr(32)
.Font.ColorIndex = wdBlack
.Collapse 0
.Select
End With
Set oRng = Nothing
End Sub