PDA

View Full Version : [SOLVED] colour From LEFT to RIGHT of a cell starting from where a COLON is found



crmpicco
06-01-2005, 03:23 AM
Is there a way i can colour From LEFT to RIGHT of a cell starting from where a COLON is found?



If Trim$(Range(sRange).Text) <> "" Then
iColonPos = InStr(Trim(Range(sRange).Text), ":")
Range(sRange).Interior.ColorIndex = iColour
End If


TIA.

Bob Phillips
06-01-2005, 04:28 AM
[QUOTE=crmpicco]Is there a way i can colour From LEFT to RIGHT of a cell starting from where a COLON is found?QUOTE]



Dim iColonPos As Long
With Range(sRange)
iColonPos = InStr(1, .Value, ":")
If iColonPos > 0 Then
.Characters(Start:=ipos, Length:=Len(.Value) - iColonPos + 1).Font.ColorIndex = 3
End If
End With