Forum Discussion

Jalil1985's avatar
Jalil1985
Copper Contributor
Jan 04, 2022

How to bold Amount in Text formula

In excel the following text i want to bold only which is following highlight text from selected section. how to bold it. 

 

="By debit to our account No.50000141, you are hereby advised to transfer an amount of" &" Rs."& TEXT(Table1[[#Totals],[Amount]], "#,##")&"/-" & "on account of salaries for the month of Dec-21. 

 

The sample file is attached for ready reference. 

 

6 Replies

    • Jalil1985's avatar
      Jalil1985
      Copper Contributor
      Is any solution is available in Power Query or VBA?
      • bosinander's avatar
        bosinander
        Iron Contributor

        Hi Jalil1985 

        I agree that it seems not possible without a macro, but with VBA it is possible.

        Put the different parts in separate cells and generate A2 as static text;

        Sub boldSum()
            part1 = Range("Part_1").Value
            part2 = Range("Part_2").Value
            part3 = Range("Part_3").Value
            
            Range("a2").Select
            ActiveCell.Value = part1 & part2 & part3
            
            ActiveCell.Characters(Start:=Len(part1), Length:=Len(part2)).Font.FontStyle = "Bold"
        End Sub

        Thus, the attached file is xlsM.

        -/-

        i5:i7 are named Part_1 to 3 to be easy possible to move to another sheet with preferences. Cut and paste and tha macro will still be functional.

Resources