Checkbox Name Referring to a Cell

This post will guide how to create a checkbox with a name referring to a cell value in excel. How do I reference checkbox name to a cell value with VBA code in excel.

Checkbox Name Referring to a Cell


If you want to create a checkbox with a name link to a cell value with VBA code, you just need to do the following steps:

#1 create a checkbox in your current worksheet.

checkbox name refer1

#2 select and right click on this checkbox, then click View Code from the drop-down menu list.

checkbox name refer2

#3 The Microsoft visual Basic for Applications window will appear. Then copy and paste the below code into the code window.

Private Sub CheckBox1_Click()
    CheckBox1.Caption = Worksheets("Sheet3").Range("B1")
End Sub

checkbox name refer3

#4 close the Microsoft Visual Basic for Application window, and go to DEVELOPER tab, click Design Mode command under Controls group to turn off Design mode.

checkbox name refer4

You will see that the checkbox1 caption name is referenced to the specified cell B1.

Comments

So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar