Making text bold / italic without VBA

DaveRowland

New Member
Joined
Nov 22, 2016
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
I am currently using the below to make writing up my reports quicker.

="The work was carried out by "&Constants!H11&" on the "&TEXT(Constants!H9, "dd/mm/yyyy")

when printing cell would look like :- The work was carried out by Dave on the 08/06/2020

The constants page contains information that is repeated often throughout, the 2 cells contain name and date for this example what I am trying to do is format the info carried forward (i.e bold or italic ) I would like to do this without VBA if possible?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi & welcome to MrExcel.
Unfortunately you can format part of the string if the cell contains a formula.
The only way would be to remove the formula & use VBA to format the string.
 
Upvote 0
Thanks Fluff
Thought that may be the case. Not that up on VBA so will look it up
 
Upvote 0
Assuming the formulae are in col A, you could use something like
VBA Code:
Sub DaveRowland()
   Dim Strt As Long, Stp As Long
   Dim Cl As Range
   
   For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
      Cl.Value = Cl.Value
      Strt = InStr(1, Cl, "by", 1) + 3
      Stp = InStr(1, Cl, " on ", 1)
      With Cl.Characters(Strt, Stp - Strt).Font
         .Bold = True
         .Italic = True
      End With
      With Cl.Characters(Len(Cl) - 9, 10).Font
         .Bold = True
         .Italic = True
      End With
   Next Cl
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,315
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top