Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
hoising8
 
Posts: n/a
Default Font and Subscript Question

I have this text string containing formulas. ="Qo = "&(ROUND(AG41,2))&" /
("&AB30&" x "&(ROUND(AG30/AB30,2))&")". I want to have the answer to
(ROUND(AG30/AB30,2)) show up as a different color. When I highlight the text
and then click the font color button, no colors are available. How do I do
that? Also, I would like to subscript the o in Qo. How would I do this?
Thanks a lot for your help.
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

You'd need to replace your formula with a VBA event macro. You could do
something like

Private Sub Worksheet_Calculate()
Const sF1 As String = "Qo = "
Const sF2 As String = " / ("
Const sF3 As String = " x "
Const sF4 As String = ")"
Dim sV1 As String
Dim sV2 As String
Dim sV3 As String

sV1 = Format(Application.Round(Range("AG41").Value, 2), "0.00")
sV2 = Format(Range("AB30").Value, "0.00")
sV3 = Format(Application.Round(Range("AG30").Value / _
Range("AB30").Value, 2), "0.00")
With Range("A1")
.Value = sF1 & sV1 & sF2 & sV2 & sF3 & sV3 & sF4
.Characters(2, 1).Font.Subscript = True
.Characters(InStr(.Text, sF3) + Len(sF3), _
Len(sV3)).Font.ColorIndex = 3
End With
End Sub

which puts the formula in A1 (change to suit), and turns the desired
portion red (Font.ColorIndex = 3).


In article ,
"hoising8" wrote:

I have this text string containing formulas. ="Qo = "&(ROUND(AG41,2))&" /
("&AB30&" x "&(ROUND(AG30/AB30,2))&")". I want to have the answer to
(ROUND(AG30/AB30,2)) show up as a different color. When I highlight the text
and then click the font color button, no colors are available. How do I do
that? Also, I would like to subscript the o in Qo. How would I do this?
Thanks a lot for your help.

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
Multiple font styles (superscript and subscript, for example) Lorraine Charts and Charting in Excel 0 January 13th 05 07:45 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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