Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Color text inserted into other text

is it possible to color code text that will be inserted into other text:

asdf="HI"
if Range("a1")<"" then
tempval=Range("a1").value
Range("a1").ClearContents
Range("A1")=tempval & asdf


but I want "asdf" to be red (existing as is)???
Is there anyway to do that other than inserting it, searching it and then
color coding it??????
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Color text inserted into other text

I think you would do it something like this:


Sub dk()
asdf = "Hi"
tempVal = Range("A1").Value & asdf
Range("A1") = tempVal
Range("A1").Characters(Len(tempVal) + 1 - Len(asdf), _
Len(asdf)).Font.ColorIndex = 3
End Sub




"jasminesy" wrote in message
...
is it possible to color code text that will be inserted into other text:

asdf="HI"
if Range("a1")<"" then
tempval=Range("a1").value
Range("a1").ClearContents
Range("A1")=tempval & asdf


but I want "asdf" to be red (existing as is)???
Is there anyway to do that other than inserting it, searching it and then
color coding it??????



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
add some text in a cell that has just been inserted Janis Excel Programming 2 October 4th 07 11:02 PM
Copy text cell & change text color conditionally manxman Excel Programming 2 August 31st 06 08:18 PM
Cond. format text color based on another's text color manxman Excel Discussion (Misc queries) 3 August 31st 06 06:27 PM
Blank space gets inserted after text Ros M New Users to Excel 2 September 26th 05 02:07 PM
Text not all displaying in a cell, what is max that can be inserted? Althea Excel Worksheet Functions 4 May 9th 05 02:41 AM


All times are GMT +1. The time now is 01:23 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"