+ Reply to Thread
Results 1 to 2 of 2

Change color of specific text within a cell?

Hybrid View

  1. #1
    avarga82@gmail.com
    Guest

    Change color of specific text within a cell?

    Guru Excel Programmers:

    Is there any way I can make text in the same cell different colors
    using VBA? If so, any pointers?


  2. #2
    ADG
    Guest

    RE: Change color of specific text within a cell?

    Try using the macro recorder to do this, and see the VBA created. You will
    want to delete some unwanted lines. Below is an example of what you might see.

    Range("A1").Select
    ActiveCell.FormulaR1C1 = "LLLLKKKKMMMM"
    With ActiveCell.Characters(Start:=1, Length:=4).Font
    .Name = "Arial"
    .FontStyle = "Regular"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = xlAutomatic
    End With
    With ActiveCell.Characters(Start:=5, Length:=5).Font
    .Name = "Arial"
    .FontStyle = "Regular"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = 3
    End With
    With ActiveCell.Characters(Start:=10, Length:=3).Font
    .Name = "Arial"
    .FontStyle = "Regular"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = xlAutomatic
    End With
    --
    Tony Green


    "avarga82@gmail.com" wrote:

    > Guru Excel Programmers:
    >
    > Is there any way I can make text in the same cell different colors
    > using VBA? If so, any pointers?
    >
    >


+ 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