If Selection.Font.Bold = False Then Selection.Font.Bold = True Else Selection.Font.Bold = False End If
This works if a range is selected.
How to create the same if a cell is in edit mode, and only a part of its content is selected ?
This is what you would use to format parts of a cell, but you can only do this after the edit is complete – like Tim Williams said.
With ActiveCell.Characters(Start:=3, Length:=2).Font .Name = "Calibri" .Size = 11 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ThemeColor = xlThemeColorLight1 .TintAndShade = 0 .ThemeFont = xlThemeFontMinor End With