Dim mm As String
Dim lstRow As Integer
Set ws1 = ast.Sheets("Exit")
lstRow = ws1.Range("S" & ws1.Rows.Count).End(xlUp).Row
Dim i As Integer
For i = 2 To lstRow
**If Len(ws1.Range("S" & i).Value) = 6 Then**
mm = Left(ws1.Range("s" & i).Value, 3)
ws1.Range("T" & i).Value = mm
ws1.Range("T" & i).Interior.Color = vbRed
End If
Next
I am going to take 3 alphabet of S column value and bring out these alphabet into T column with red color. But I am facing type mismatch error in ** line. ast is file name and ws1 is worksheet name.