+ Reply to Thread
Results 1 to 3 of 3

How to make checkbox change cell color?

Hybrid View

  1. #1
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Instead of putting check box... you can do the following and achieve the same result...


    Remove the checkboxes.
    Select the entire column.
    Format the font of that column to Webdings ( Size 20 ).

    No apply conditional formating in that column.
    Condition cell value "is equal to" "a".

    Now if you type "a" in that column it will appear as TICK and it will be formatted as per the formatting given in conditional formatting.

    See attached file for clarification

    Hope this helps you
    Attached Files Attached Files
    Last edited by Shijesh Kumar; 06-17-2008 at 11:34 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello walkingthecow,

    This macro has been added to the Check Boxes on in your workbook. When checked the cell will be greeen (color index 43), and when not checked the cell color is removed.
    Sub ChangeCellColor()
    
      Dim C As Long
      Dim ChkBox As Excel.CheckBox
      Dim R As Long
      
        Set ChkBox = ActiveSheet.CheckBoxes(Application.Caller)
        
          With ChkBox
            R = (.TopLeftCell.Row + .BottomRightCell.Row) / 2
            C = (.TopLeftCell.Column + .BottomRightCell.Column) / 2
          End With
          
          If ChkBox.Value = xlOn Then
            Cells(R, C).Interior.ColorIndex = 43
          Else
            Cells(R, C).Interior.ColorIndex = xlColorIndexNone
          End If
          
    End Sub
    Sincerely,
    Leith Ross
    Attached Files Attached Files

+ 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