+ Reply to Thread
Results 1 to 4 of 4

Cell highlight colour

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Cell highlight colour

    I would like to create a macro that will fill cells with 3 different colours:

    If a cell has no colour, then it will fill it orange... Then, if ran again on the same cell, it will identify that it is orange and fill it in blue.... Then, if ran again on the same cell, it will identify that it is blue and fill it red. Then, if ran again on the same cell, it will identify that it is red and fill it orange (back where it started). any help appreciated!! thx
    Last edited by Xx7; 02-11-2011 at 03:25 AM.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Cell highlight colour

    Hi
    try

    Sub colorchange()
    If ActiveCell.Interior.ColorIndex = xlNone Then
    ActiveCell.Interior.ColorIndex = 44
    ElseIf ActiveCell.Interior.ColorIndex = 44 Then ActiveCell.Interior.ColorIndex = 33
    ElseIf ActiveCell.Interior.ColorIndex = 33 Then ActiveCell.Interior.ColorIndex = 3
    ElseIf ActiveCell.Interior.ColorIndex = 3 Then ActiveCell.Interior.ColorIndex = xlNone
    End If
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: Cell highlight colour

    Impressive... thanks!

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Cell highlight colour

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

+ Reply to Thread

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