string - excel vba选择单元格中的倒数第二个字符

标签 string excel format cell vba

我认为这很简单,但在任何地方都找不到解决方案!我正在编写一个宏以在单元格中的现有文本之后插入一个红色勾号(或向下箭头)。

 ActiveCell.FormulaR1C1 = ActiveCell & " P "
P 需要格式化为粗体、红色和 Wingdings 2。它后面需要一个空格,以防将来在末尾添加文本。
如果在正文之前没问题:
With ActiveCell.Characters(Start:=2, length:=1).Font
当它是单元格中的倒数第二个字符时,如何选择它?
(或者还有其他方法可以实现吗?)

最佳答案

尝试这个:

With ActiveCell.Characters(ActiveCell.Characters.count - 1, 1).Font
  .name = "Wingdings 2"
  .Bold = True
End With

关于string - excel vba选择单元格中的倒数第二个字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45256928/

相关文章:

javascript - 如何用 Ext JS 格式化返回的 JSON 字符串值?

vba - Excel VBA Exit For 在 If block 内不起作用

excel - 使用 AutoFilter 过滤列

python - 在 Python 中逐 block 读取、切片和重构数据文件

android - 将 TextView 转换为字符串(某种)Android

excel - 在 Excel 工作表名称中使用井号 (#)

java - 如何将.der文件中的私钥加载到java私钥对象中

ios - 无法使用属性访问.size : from String

python /杰森 : If substring in string always results in TypeError: string member test needs char left operand

C++ 字符串操作/输入