EXCEL中如何在这段VBA代码中添加字体加粗的命令
SubSs()DimcAsRangen=InputBox("请输入需改变颜色的词语:")Ifn=""ThenExitSubForEachcInActiveSheet.Us...
Sub Ss()
Dim c As Range
n = InputBox("请输入需改变颜色的词语:")
If n = "" Then Exit Sub
For Each c In ActiveSheet.UsedRange
i = 1
While InStr(i, c, n, 0) > 0
i0 = InStr(i, c, n, 0)
If i0 > 0 Then c.Characters(i0, Len(n)).Font.Color = vbRed: i = i0 + Len(n)
Wend
Next
End Sub 展开
Dim c As Range
n = InputBox("请输入需改变颜色的词语:")
If n = "" Then Exit Sub
For Each c In ActiveSheet.UsedRange
i = 1
While InStr(i, c, n, 0) > 0
i0 = InStr(i, c, n, 0)
If i0 > 0 Then c.Characters(i0, Len(n)).Font.Color = vbRed: i = i0 + Len(n)
Wend
Next
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询