+ Reply to Thread
Results 1 to 6 of 6

Change Font Colour in Autoshape

Hybrid View

  1. #1
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Change Font Colour in Autoshape

    Try below Code

    Option Explicit
    Dim MyShape As Shape
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Not Intersect(Target, Range("A1")) Is Nothing Then
        
            Set MyShape = ActiveSheet.Shapes(1)
            
            With MyShape.TextFrame.Characters.Font
                If Range("A1") = 1 Then
                    .Color = 2             'Black
                ElseIf Range("A1") = 2 Then
                    .Color = 5287936       'Green
                ElseIf Range("A1") = 3 Then
                    .Color = 15773696      'Blue
                Else
                    .Color = 65535         'Yellow
                End If
            End With
        End If
    End Sub
    How to use:
    1. Copy above code.
    2. Right Click to the sheet and select View Code
    3. Paste code into the right pane.
    4. Press Alt + Q to close the VBE.
    5. Save workbook before any other changes.
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1