Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ADG ADG is offline
external usenet poster
 
Posts: 76
Default 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


" 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change Font color specific text jlr Excel Discussion (Misc queries) 1 May 6th 10 08:19 PM
Change the color of a cell or text with an if statement Oddcarout Excel Discussion (Misc queries) 10 September 8th 07 12:16 AM
Move text that is a specific color to a different cell Alison84 Excel Worksheet Functions 3 November 15th 06 04:12 PM
count by specific text color in range of cell Tii99 Excel Discussion (Misc queries) 2 April 4th 06 09:58 AM
Cell text color change Steffen Excel Discussion (Misc queries) 1 February 23rd 05 10:31 PM


All times are GMT +1. The time now is 09:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"