Consulting

Results 1 to 2 of 2

Thread: Red Suit Symbols Macro

  1. #1
    VBAX Newbie
    Joined
    Mar 2018
    Posts
    1
    Location

    Red Suit Symbols Macro

    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?

  2. #2
    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
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •