Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2004

Tip: Looking for answers? Try searching our database.

CheckBox Label

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pablo - 12 Oct 2004 04:43 GMT
How do you make a checkbox label equal a cell input?

For example, the cell A3 = "Blue", how do you make the label for the check
box say "Blue" so that if I change A3 to "Red" the checkbox label will now
say "Red"?
Stefan H?gglund [MSFT] - 12 Oct 2004 08:18 GMT
Hi Pablo!

You can use a macro that update he checkbox label, like the sample below:

1. Open the workbook where you want this macro
2. Open the Visual Basic editor (Tools, Macro, Visual Basic Editor)
3. In the Project window, doubleclick on the "Sheet1" object (or the
sheetname where you have the check box and cell where you enter the checkbox
label) in "Microsoft Excel objects" for this workbook.
4. Paste the code below to the Code-window and
- change the cell-address to the cell where you enter the label for the
check box (cell A1 in the sample)
- the name of the checkbox you use (if you don't know the name, then you can
rightlick the checkbox in the worksheet and see the name in the namebox to
the left of the formula field)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
   xx = ActiveCell.Address
   CheckBoxName = Range("a1").Text               'Here you can change the
cell-address where you have the name for the check box.
   ActiveSheet.Shapes("Check Box 1").Select     'Here you can change the
name of your check box
   Selection.Characters.Text = CheckBoxName
   Range(xx).Select
End Sub

Now when you change the name for the checkbox in the cell, the
checkbox-label is updated.

Best regards

Stefan H?gglund
Microsoft

> How do you make a checkbox label equal a cell input?
>
> For example, the cell A3 = "Blue", how do you make the label for the check
> box say "Blue" so that if I change A3 to "Red" the checkbox label will now
> say "Red"?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.