VBA BackColor property of checkbox control is used to change or sets the background color of checkbox control.

PREMIUM TEMPLATES LIMITED TIME OFFER

ON SALE80% OFF

50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates


CheckBox BackColor Property

[RGB Color Code]

Or

CheckBoxName.BackColor=[Hexa Decimal]

Where CheckBoxName represents a CheckBox object. In the above syntax we are using a ‘BackColor’ property of CheckBox object to change back ground color of CheckBox object.

CheckBox BackColor Property – Example

Here is the example for CheckBox Back Color Property. It will take you through how to change back color property of Check Box using Excel VBA. Here you can find or see how we are changing back color property of Check Box manually or using code.

CheckBox BackColor Property: Change Manually

Please find the following details how we are changing manually back Color of CheckBox property.

  1. Go To Developer Tab and then click Visual Basic from the Code or Press Alt+F11.
  2. Go To Insert Menu, Click UserForm. Please find the screenshot for the same.
  3. Excel VBA UserForm CheckBox

  4. Drag a CheckBox on the Userform from the Toolbox.Please find the screenshot for the same.
  5. CheckBox Properties_D

  6. Right click on the Check Box. Click on properties from the available list.
  7. CheckBox Properties1

  8. Now you can find the properties window of CheckBox on the screen. Please find the screenshot for the same.
  9. CheckBox Properties

  10. On the left side find ‘BackColor’ from the available Check Box properties.
  11. On the right side you can see the list of color codes.Please find the below screen shot for the same.
  12. BackColor Property of CheckBox Control

  13. You can change the back color according to your wish from the available color codes.
  14. Now, You can see the back ground color of Check Box Control.

CheckBox BackColor Property: Change Using Code

Please find the following details how we are changing back color of CheckBox property with using Excel VBA code.

  1. Go To Developer Tab and then click Visual Basic from the Code or Press Alt+F11.
  2. Go To Insert Menu, Click UserForm. Please find the screenshot for the same.
  3. Excel VBA UserForm CheckBox

  4. Drag a CheckBox on the Userform from the Toolbox. Please find the screenshot for the same.
  5. CheckBox Properties_D

  6. Double Click on the UserForm, and select the Userform event as shown in the below screen shot.
  7. Check Box Excel ActiveX Control _Im1

  8. Now can see the following code in the module.
  9. Private Sub UserForm_Initialize()
    End Sub
    
  10. Now, add the following example code1 or code2 to the in between above event procedure. The procedure should be shown as below.
  11. Example Code1: Using RGB

    'Back Color Property of CheckBox Control
    Private Sub UserForm_Initialize()
    CheckBox1.BackColor = RGB(153, 153, 255)
    End Sub
    

    Example Code2: Using Hexa Decimal

    'Back Color Property of CheckBox Control
    Private Sub UserForm_Initialize()
    CheckBox1.BackColor = &HFF8080
    End Sub
    

    Output:

    BackColor Property of CheckBox_O

LIMITED TIME OFFER

Leave A Comment


Related pages


how to merge and center on excelmeaning of vlookupexcel write macromicro in excel 2007trim function in vbaexcell find duplicatesexcel formula codesif statement excel 2010construction estimate excel templatewindows excel shortcut keysproject planning and scheduling in excellistbox in accessvba popuppublic variable vbaexcel template for tracking tasksado odbcadodb openexcel 2007 hotkeysdatabase ddl dmlpmo dashboard template excelexcel vba application.getopenfilenamehow to unhide column a in excel 2007how to delete columns in excelsql beginnersexcel consolidate columns into oneremove duplicate in excel 2003enableevents vbaadd developer tab to ribbon word 2013excel deduplicationindirect function in vbaexcel vba open files in foldercheckbox vbaexcel vba form examplesvba linefeedwhat are dml and ddl commands in sql serverusing advanced filter in excelmsgbox function in vbscripthow do you delete blank rows in excelfind duplicates exceleliminate duplicates excelifs function in excelautomation vbacreate a excel macrousing countif function in excelvba dir functionexcel vba chart seriescollectionfree construction estimate template excelgoto vbacell vba excelunprotect excel macrovlookup shortcuttrim in excel 2007how to label columns in excelvba popup boxexcel pivotingexcel vba trimvba expertsdo while loop in excel vbaunprotect workbookexcel 2007 merge cellsvba code in excel exampleshow to declare a public variable in vbaiferror vbainterview questions and answers for mis executiveexcel sales dashboard templatesactivesheet nameexcel activeworkbook.saveasmerge and center cells exceldays360 functionexcel templates for project managementmacro to close excel fileexcel workbook protectionopen xlsx file with excel 2003switch statement in vba