Consulting

Results 1 to 2 of 2

Thread: colour From LEFT to RIGHT of a cell starting from where a COLON is found

  1. #1

    colour From LEFT to RIGHT of a cell starting from where a COLON is found

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •