How to count characters in cell and then highlight.
How to count characters in cell and then highlight.
Last edited by ss2012; 08-22-2019 at 12:31 AM.
Option Explicit Sub test() Dim r As Range Dim s As String Dim k As Long Dim n As Long Set r = ActiveCell r.Font.Color = vbBlack s = r.Value For k = 1 To Len(s) If Mid(s, k, 1) Like "[!0-9]" Then n = n + 1 r.Characters(k, 1).Font.Color = vbRed End If Next MsgBox n End Sub
マナ