Results 1 to 3 of 3

Color cells if the cells have value

Threaded View

  1. #1
    Registered User
    Join Date
    06-22-2011
    Location
    location
    MS-Off Ver
    Excel 2007
    Posts
    47

    Color cells if the cells have value

    hello!

    I would like to have the cells colored if the cells have value. I tried to do it myself but the code is too long...is any other way to to this?
    The range is b6:b200. and range O6-U200. There are some gaps, that's why I take cell by cell!
    What I have so far is:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If [b6] <> "" Then [b6].Interior.ColorIndex = 8
    If [b6] = "" Then [b6].Interior.ColorIndex = xlNone
    If [b7] <> "" Then [b7].Interior.ColorIndex = 8
    If [b7] = "" Then [b7].Interior.ColorIndex = xlNone
    
    If [b9] <> "" Then [b9].Interior.ColorIndex = 8
    If [b9] = "" Then [b9].Interior.ColorIndex = xlNone
    '
    '
    
    End Sub
    Any help is really appreciated!
    tim
    Last edited by tim5; 01-15-2012 at 02:04 AM.

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