如何在Microsoft Excel VBA中添加带有修改的字体选项的现有单元格附加文本

例如Microsoft VBA:

ActiveCell = ActiveCell & <Some Text i want to add with option Size = 20> 

我如何在“<>”括号内实现这个描述

您想要更改ActiveCell.Characters()。Font属性

 Dim CurrentText, SomeText Dim CurrentTextLen, SomeTextLen CurrentText = ActiveCell.Value CurrentTextLen = Len(CurrentText) SomeText = "Some Text i want to add with option Size = 20" SomeTextLen = Len(SomeText) ActiveCell.Value = CurrentText & SomeText With ActiveCell.Characters(Start:=CurrentTextLen + 1, Length:=SomeTextLen).Font .Size = 20 End With 

为此,您需要知道<>文本的起始位置(即ActiveCell当前内容的长度加1)

您还需要您的<>文本的长度(即<>文本的长度)