PC Review


Reply
Thread Tools Rate Thread

Color text inserted into other text

 
 
jasminesy
Guest
Posts: n/a
 
      7th May 2009
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 With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      7th May 2009
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" <(E-Mail Removed)> wrote in message
news:554BB9D8-9131-4A94-B5F8-(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a string text be inserted within an Error Alert text box? MichaelRLanier@gmail.com Microsoft Excel Discussion 2 1st Dec 2008 03:33 PM
In Justify why does inserted text sometimes replace existing text =?Utf-8?B?cnllYnJp?= Microsoft Word Document Management 1 27th Mar 2006 01:37 AM
Dragging Text to be inserted in Text Box - Highlighting Drop locat =?Utf-8?B?SmltIE5pY29sc29u?= Microsoft Dot NET Framework Forms 0 23rd Jan 2006 11:42 PM
How do I make text wrap an inserted image/pic within a text box? =?Utf-8?B?a3c=?= Microsoft Powerpoint 1 28th Jun 2005 11:43 PM
When I select text to type over it my new text's inserted infront =?Utf-8?B?RGlnYnkgTW9ycmlzb24=?= Microsoft Word Document Management 1 2nd Jun 2005 08:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:20 PM.