Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2008

Tip: Looking for answers? Try searching our database.

Multicolored Dynamic Text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hall.jeff@gmail.com - 03 Apr 2008 20:26 GMT
I'm trying to build a check for customers that will highlight verbiage
when something isn't allowed... This would be my optimal solution

="Currently it adds up to "&TEXT(D14,"0.0")&" which is
"&IF(MOD(D14,1)=0,"",text("NOT ","[Red]"))&"a whole number."

The part of interest there is the text("NOT ","[Red]") function... I'd
like the "NOT" to appear in red with the rest showing up in black but
this doesn't seem possible... I also tried doing it through VBA but
that proved to not work either...

Any ideas?
Jim Rech - 03 Apr 2008 21:19 GMT
It's not possible to do what you want with a formula.  A macro can do it:

   ActiveCell.Value = "This is RED text"
   ActiveCell.Characters(9, 3).Font.ColorIndex = 3

Signature

Jim

| I'm trying to build a check for customers that will highlight verbiage
| when something isn't allowed... This would be my optimal solution
[quoted text clipped - 8 lines]
|
| Any ideas?
hall.jeff@gmail.com - 03 Apr 2008 21:25 GMT
That's what I figured... I really don't want to have to deal with the
overhead associated with a _SheetChange or _SheetCalculate scenario...
I think I'm stuck rewriting the stupid thing...

Thank you
Jeff Hall - 04 Apr 2008 11:57 GMT
Have you considered writing a function, rather than a macro?

This way, you can pass D14 as a parameter, calculate the cell contents and
then format the cell.  I suspect you will have to pass the address of the
active cell to the function because "ActiveCell" won't be appropriate in
the function.

Regards
Jeff Hall (coincidence!)

> *From:* hall.jeff@gmail.com
> *Date:* Thu, 3 Apr 2008 13:25:24 -0700 (PDT)
>
> That's what I figured... I really don't want to have to deal with the
> overhead associated with a _SheetChange or _SheetCalculate scenario...
> I think I'm stuck rewriting the stupid thing...

> Thank you
>
[quoted text clipped - 18 lines]
> |
> | Any ideas?
Jim Rech - 04 Apr 2008 16:53 GMT
Jeff-

A formula (using either built-in Excel functions or a UDF) cannot return a
partially formatted string.  Or any kind of format.  Formulas return values
to cells and that's it.

Take that as a challenge if you want<g>.

Signature

Jim

> Have you considered writing a function, rather than a macro?
>
[quoted text clipped - 35 lines]
>> |
>> | Any ideas?
Jeff Hall - 05 Apr 2008 00:30 GMT
Hmmm... I see what you mean! A function would have to return a value before
it could attempt to format the result and even if the latter were possible,
it's too late after the function has completed.

Jeff

> *From:* "Jim Rech" <jrrech@live.com>
> *Date:* Fri, 4 Apr 2008 11:53:37 -0400
[quoted text clipped - 51 lines]
> >> |
> >> | Any ideas?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.