如何在Excel单元格中select范围

我想让VBA添加删除线到选定的文本,但找不到任何方法来做到这一点。

这是logging我想要的行动。

ActiveCell.Characters(Start:=7, Length:=5).Font 

在这里,我想通过select罢工。 Excel中是否有Word中的select对象?

要运行在一个单元格的select,如:

 Sub Test() Dim rng1 As Range If TypeName(Selection) = "Range" Then Set rng1 = Selection For Each rng2 In rng1.Cells If Len(rng2.Value2) > 12 Then rng2.Characters(7, 5).Font.Strikethrough = True Next End If End Sub 

你可以直接使用单元格,不需要激活。 我在手机上,但是像

 cells(2,1).Select Selection.font.strikethrough=true 

可以重新编码为cells(2,1).font.strikethrough = true

或者按照你的例子, ActiveCell.font.strikethrough= true

要么

ActiveCell.Characters(Start:=7, Length:=5).Font.Strikethrough= true可能工作,我从来没有使用它的characters ()所以我不积极