Results 1 to 6 of 6

Select cells by colorindex

Threaded View

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2010
    Posts
    3

    Select cells by colorindex

    Hello all,

    I'd like to write a macro that selects all cells with a certain background. The color I'm looking for is (255,217,102). I want to select all cells in the sheet with this background color, and then change the value of these cells. I'm fairly certain this can be done, but I've never been great with VBA. This is what I'm trying so far:

    Sub fff()
    
    If Application.Cells.Interior.ColorIndex = RGB(255, 217, 102) Then
        Application.Cells.Value = 0
    End If
    
    End Sub
    0 is not the actual value I want but I've been using it to test.
    Can someone please help me?
    Last edited by JBeaucaire; 02-12-2013 at 11:40 AM. Reason: Added code tags, as per forum rules. Don't forget!

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