如果单元格处于编辑模式,如何切换粗体或斜体?

If Selection.Font.Bold = False Then Selection.Font.Bold = True Else Selection.Font.Bold = False End If 

如果select范围,这将起作用。
如果一个单元格处于编辑模式,如何创build相同的内容,只有一部分内容被选中?

这是你用来格式化单元格的一部分,但是你只能在编辑完成后才能做到这一点,就像Tim Williams说的那样。

 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