Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number Formatting in a concatenated cell | Excel Worksheet Functions | |||
Change font formatting in a concatenated string | Excel Discussion (Misc queries) | |||
sorting a concatenated cell | Excel Discussion (Misc queries) | |||
mix font styles in concatenated text | Excel Worksheet Functions | |||
Changing Font Characteristics Within a Formula | Excel Discussion (Misc queries) |