Sub Highlight_Error_Digits()
Dim ws As Worksheet, minLen As Long, i As Long, c As Range, clr As Long
Dim Pi_String As String, Pi_Entrd_String As String 'every variable needs a type
Set ws = ThisWorkbook.Worksheets("Pi_Key'd_In")
Pi_String = ws.Range("C14").Value
Pi_Entrd_String = ws.Range("C13").Value
minLen = Application.Min(Len(Pi_String), Len(Pi_Entrd_String))
Set c = ws.Range("C16")
c.NumberFormat = "@" 'set format to "Text"
c.Font.Color = vbBlack 'reset cell font
c.Value = Pi_Entrd_String
For i = 1 To minLen
clr = IIf(Mid(Pi_String, i, 1) = Mid(Pi_Entrd_String, i, 1), vbBlack, vbRed) 'Color?
c.Characters(i, 1).Font.Color = clr
Next i
/* this next part is what is not working */
If Pi_Entrd_String = Pi_String Then
c.Font = vbWhite
c.Value = ""
End If
End Sub
/* received help with highlighting the errors and that works fine, but if there are no errors then I do not want to write the pi string to Range(“C16”) */