excel怎么把单元格内某个字标红,其他字不变

alt+F11,打开宏编辑器运行如下代码:

Sub AAA()

    Dim R As Range, L As Long, S As String

    Application.ScreenUpdating = False

    S = "红"  '要标记的字符

    L = Len(S)

    For Each R In Selection

        If InStr(R, S) > 0 Then R.Characters(InStr(R, S), L).Font.Color = vbRed

    Next

    Application.ScreenUpdating = True

End Sub

  

转载于:https://www.cnblogs.com/goding/p/10400037.html

    原文作者:weixin_33830216
    原文地址: https://blog.csdn.net/weixin_33830216/article/details/94721739
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞