ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting font with concantenated string (https://www.excelbanter.com/excel-programming/285398-formatting-font-concantenated-string.html)

Todd[_7_]

Formatting font with concantenated string
 
Hi,

I'm new to the visual basic world so please bare with
me. I have the following string:

="If Q1 revenue is equal to "&TEXT(A10,"$#,##0")&" then
everything is on track for fiscal 2004."

I would like to able to keep everything as is and change
only "Q1" to bold, blue font.

Any suggestions?

Thanks very much,
Todd






Bob Phillips[_5_]

Formatting font with concantenated string
 
If it's a once-off, just select the Q1 part in the formula bar, and change
the font colour to blue.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Todd" wrote in message
...
Hi,

I'm new to the visual basic world so please bare with
me. I have the following string:

="If Q1 revenue is equal to "&TEXT(A10,"$#,##0")&" then
everything is on track for fiscal 2004."

I would like to able to keep everything as is and change
only "Q1" to bold, blue font.

Any suggestions?

Thanks very much,
Todd








Vasant Nanavati

Formatting font with concantenated string
 
Unfortunately, since your string is the result of a formula, I don't believe
this can be done.

--

Vasant

"Todd" wrote in message
...
Hi,

I'm new to the visual basic world so please bare with
me. I have the following string:

="If Q1 revenue is equal to "&TEXT(A10,"$#,##0")&" then
everything is on track for fiscal 2004."

I would like to able to keep everything as is and change
only "Q1" to bold, blue font.

Any suggestions?

Thanks very much,
Todd








J.E. McGimpsey

Formatting font with concantenated string
 
you can't apply character formatting to the result of a formula.
However, you could use an event macro.

Put this in the worksheet code module (right-click on the worksheet
tab and select View Code):

Private Sub Worksheet_Calculate()
With Range("B10")
.Value = "If Q1 revenue is equal to " & _
Format(Range("A10").Value, "$#,##0") & _
" then everything is on track for fiscal 2004."
With .Characters(4, 2).Font
.Bold = True
.ColorIndex = 5
End With
End With
End Sub

Change "B10" to suit

In article ,
"Todd" wrote:

Hi,

I'm new to the visual basic world so please bare with
me. I have the following string:

="If Q1 revenue is equal to "&TEXT(A10,"$#,##0")&" then
everything is on track for fiscal 2004."

I would like to able to keep everything as is and change
only "Q1" to bold, blue font.

Any suggestions?

Thanks very much,
Todd







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

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