Results 1 to 10 of 10

Number change color depend if left cell turn yellow

Threaded View

unley Number change color depend if... 05-31-2011, 10:16 PM
Mordred Re: Number change color... 06-01-2011, 01:43 AM
Mordred Re: Number change color... 06-01-2011, 01:57 AM
unley Re: Number change color... 06-01-2011, 02:01 AM
Mordred Re: Number change color... 06-01-2011, 02:05 AM
unley Re: Number change color... 06-01-2011, 02:14 AM
unley Re: Number change color... 06-01-2011, 02:18 AM
Mordred Re: Number change color... 06-01-2011, 02:29 AM
unley Re: Number change color... 06-01-2011, 02:35 AM
Mordred Re: Number change color... 06-01-2011, 02:38 AM
  1. #1
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Number change color depend if left cell turn yellow

    Hi to all

    I've been searching for colorfuntion or colorfont in this site and Google for my likeness but have not luck.

    I have to create a spreadsheet for others who dont know much about Excel.

    Numbers in E column is to change color if B column in same row turn yellow.

    There are number 1 to 5 in E column

    Like number 5 in Column E turn blue if cell in B column in same row turn yellow
    and number 4 in Column E turn green and number 3 in Column E turn pink and so on.

    I tried this code but have no luck

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    Dim i As Long
    Sheets("Sheet1").Activate
    For i = 5 To 26
        If Range("E" & i).Value = "5" & Range("B" & i).Value = Interior.ColorIndex = 6 Then
           Range("E" & i).Interior.ColorIndex = 5
       End If
        If Range("E" & i).Value = "4" & Range("B" & i).Value = Interior.ColorIndex = 6 Then
           Range("E" & i).Interior.ColorIndex = 10
       End If
           If Range("E" & i).Value = "3" & Range("B" & i).Value = Interior.ColorIndex = 6 Then
           Range("E" & i).Interior.ColorIndex = 7
       End If
    
    Next i
    End Sub

    I attached sample book for you to see

    NumberChangeColor2.xlsm
    Last edited by unley; 06-01-2011 at 02:40 AM.
    I'm using MS Office 2013

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1