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


word vba formloop formula in excelexcel spreadsheet password protectconsolidate data in excel from multiple worksheetsexcel filter duplicate rowsunlock macro exceliferror function excel 2010vba for excel tutorialshortcut key for deleting sheet in excelformat vbaset activesheetfso file existsdata mining viva questions and answersexcel 2003 vbaexcel consolidate data from multiple rowsexcel what if statementsvba selection.deleterun macros in excel 2007excel option button valuevlookup excel vbamessage box vba yes nocountif examplechart wizardexcel vba current rowexcel undo macroselect vba3d chart excelvba colour indexvba dim as rangeexcel formulas with exampleshow to delete empty cellsexcel vba unhide all sheetsexcel formula logical operatorsmacros in excel tutorial for beginnersproject costing spreadsheetvba open excel filemacro excel vbaexcel pivot tutorialautofit column width exceldynamic chart titlebuilding macros in excel 2010combine multiple cells in excelvlookup vba excelsumif formula in excelexcel cell background colorremove duplicate rows excelvlookup demoexcel formulas and examplesvba enumerationweek planner excelexcel formulas tutorial with examplesexcel macro clear cellsexcel 2007 macros tutorialvba select workbooklookup excelsumif function examplesunlock excel worksheet without passwordvba skillspivot a table in excelmicrosoft vba excelaction log template excelexcel 2007 paste specialdefault row height in excelhow to do pivot tables in excel 2013excel vba count cells in rangecreate a pivot chartexcel vba formsinterview questions on vbhorizontal lookup in exceladvance filter excelunlock password excelvba cut and pastehow to create excel macrostrim function vbahow to check duplicates in excel 2007vba variablesconditionals in excelhow to use pivot chart in excel 2007microsoft office excel 2007 templateswhat are vba macros