correct syntax for LEFT in vba
"Howard" wrote:
What's the correct syntax
[....]
Dim Celln As Range
[....]
If Left(Celln, 2).Value = Range("B15").Value Then
Celln.Interior.ColorIndex = 3
End If
It is sufficient to write:
If Left(Celln, 2) = Range("B15") Then
Celln.Interior.ColorIndex = 3
End If
But if you feel better using .Value explicitly, then:
If Left(Celln.Value, 2) = Range("B15").Value Then
Celln.Interior.ColorIndex = 3
End If
|