[英]How i can add to existing cell additional text with modified font options in Microsoft Excel VBA
For example Microsoft VBA: 例如,Microsoft VBA:
ActiveCell = ActiveCell & <Some Text i want to add with option Size = 20>
How i can implement that description inside "<>" brackets 我如何在“ <>”括号内实现该描述
You want to change the ActiveCell.Characters().Font property 您想要更改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
For this, you need to know where your <> text starts (ie the length of the ActiveCell current contents, plus one) 为此,您需要知道<>文本的起始位置(即ActiveCell当前内容的长度加一)。
You will also need the length of your <> text (ie the length of the <> text) 您还需要<>文本的长度(即<>文本的长度)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.