+ Reply to Thread
Results 1 to 3 of 3

Macro to change all cells with a certain background color in another background color

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro to change all cells with a certain background color in another background color

    Hello all,

    I am using Excel 2007.
    I am trying to change the background color of all cells with a certain background by using a macro.

    So far, I came up with this:

    Sub changecolor()

    If ActiveCell.Interior.Color = RGB(255, 51, 51) Then
    ActiveCell.Interior.Color = RGB(146, 208, 80)
    End If

    End Sub

    But this only changes the color of a selected cell.
    How can I change all cells instead of only the selected?
    Many thanks in advance!

    Kevin

  2. #2
    Forum Contributor tkowal's Avatar
    Join Date
    11-20-2010
    Location
    Miami, Fl
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: Macro to change all cells with a certain background color in another background color

    Please Login or Register  to view this content.
    Last edited by tkowal; 06-13-2012 at 10:53 AM. Reason: Code Correction
    Ted
    "Live Long and Prosper"

  3. #3
    Registered User
    Join Date
    06-13-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Macro to change all cells with a certain background color in another background color

    This works great!

    Thank you very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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