Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Different font characteristics in concatenated cell

I have a spreadsheet with the following formula: =IF(F2="",C2,F2&":
"&C2) which produces the desired result of CA: Los Angeles Facility
or if there is no code in F2,
Los Angeles Facility

How do I change the font characteristics of "CA:" in the concatenated
cell? I found the code below, but I'm not smart enough to update the
code from the actual text of " Bold Text " to reference instead (F2)
or the (F2)'s text in the cell with the formula (B2).

Any help is greatly appreciated!


Private Sub Worksheet_Calculate()
Const BoldText As String = " Bold Text "
Const ItalicText As String = " Italic Text "
Const DifferentSizedFontText As String = _
" Different Sized Font "


Application.EnableEvents = False
With Range("B1")
.Value = Range("A1").Text & BoldText & _
Range("A2").Text & ItalicText & _
Range("A3").Text & DifferentSizedFontText
.Characters(InStr(.Text, BoldText), _
Len(BoldText)).Font.Bold = True
.Characters(InStr(.Text, ItalicText), _
Len(ItalicText)).Font.Italic = True
.Characters(InStr(.Text, _
DifferentSizedFontText)).Font.Size = 24
End With
Application.EnableEvents = True
End Sub

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
Number Formatting in a concatenated cell ibgolfn Excel Worksheet Functions 4 January 15th 08 10:41 PM
Change font formatting in a concatenated string Michael R Excel Discussion (Misc queries) 1 February 23rd 07 04:16 PM
sorting a concatenated cell wmack Excel Discussion (Misc queries) 3 August 21st 06 01:20 PM
mix font styles in concatenated text Lakeside Steph Excel Worksheet Functions 2 May 26th 06 05:46 PM
Changing Font Characteristics Within a Formula jdurrmsu Excel Discussion (Misc queries) 3 September 14th 05 09:45 PM


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