ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Format text in formula line (https://www.excelbanter.com/excel-worksheet-functions/228716-format-text-formula-line.html)

mge

Format text in formula line
 
Is there a way to format specific text in a formula line. For example, can I
make the 1 superscript in the following formula line.

="The current tax rate1 is "&F19*100&"%."

--
mgelde

Harlan Grove[_2_]

Format text in formula line
 
mge wrote...
Is there a way to format specific text in a formula line. For example, can I
make the 1 superscript in the following formula line.

="The current tax rate1 is "&F19*100&"%."


No.

Rick Rothstein

Format text in formula line
 
No, not with a formula, but it is possible to do what you want with VB event
code. Give this a try and see if you can use it or not. Right click on the
tab at the bottom of the worksheet, select View Code from the popup menu
that appears, copy/paste this code into the code window that appeared...

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Column = 6 Then 'Monitor changes in Column F
With .Offset(, 1) 'Puts output in Column G (one to right of Column F)
.Value = "The current tax rate1 is " & 100 * Target.Value & "%"
.Characters(21, 1).Font.Superscript = True
End With
End If
End With
End Sub

Now, go back to your worksheet and enter a value in Column F... the output
will be placed in Column G. The above code assumes values are placed in
Column F manually as opposed to having its values derived from formulas.

--
Rick (MVP - Excel)


"mge" wrote in message
...
Is there a way to format specific text in a formula line. For example, can
I
make the 1 superscript in the following formula line.

="The current tax rate1 is "&F19*100&"%."

--
mgelde



mge

Format text in formula line
 
After playing with this a bit I used the following.

="The current tax rate"&CHAR(185)&" is "&F19*100&"%."

Using the CHAR function gave me the superscript 1.

I do like Rick's response and will try it in the future when I need special
formating within a cell.
--
mgelde


"mge" wrote:

Is there a way to format specific text in a formula line. For example, can I
make the 1 superscript in the following formula line.

="The current tax rate1 is "&F19*100&"%."

--
mgelde


mge

Format text in formula line
 
Rick - When I try this I get a compile error - Syntax error
--
mgelde


"mge" wrote:

Is there a way to format specific text in a formula line. For example, can I
make the 1 superscript in the following formula line.

="The current tax rate1 is "&F19*100&"%."

--
mgelde


mge

Format text in formula line
 
Rick - regarding my previous, I inserted an extra space when I copied your
script. It works now.
--
mgelde


"mge" wrote:

Is there a way to format specific text in a formula line. For example, can I
make the 1 superscript in the following formula line.

="The current tax rate1 is "&F19*100&"%."

--
mgelde


Teethless mama

Format text in formula line
 
can I make the 1 superscript in the following formula line.

Oh yes you can

Try this:
="The current tax rate"&CHAR(185)& " is "&F19*100&"%."


"mge" wrote:

Is there a way to format specific text in a formula line. For example, can I
make the 1 superscript in the following formula line.

="The current tax rate1 is "&F19*100&"%."

--
mgelde



All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com