Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is probably simple but I cannot figure out the syntax. I have a few
checkboxes on a sheet that I would like to have run a macro that would bold or unbold based on the value of the checkbox or its cell reference. I'm not sure if there is a better way than a macro or not. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's what I found that worked:
Sub Check2() Range("A22").Select If ActiveCell.Value = "True" Then Range("B22").Select Selection.Font.Bold = True Else Range("B22").Select Selection.Font.Bold = False End If End Sub "JCanyoneer" wrote: This is probably simple but I cannot figure out the syntax. I have a few checkboxes on a sheet that I would like to have run a macro that would bold or unbold based on the value of the checkbox or its cell reference. I'm not sure if there is a better way than a macro or not. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
too much code
Sub Check2() Range("B22").Font.Bold = Range("A22").Value End Sub -- HTH RP "JCanyoneer" wrote in message ... Here's what I found that worked: Sub Check2() Range("A22").Select If ActiveCell.Value = "True" Then Range("B22").Select Selection.Font.Bold = True Else Range("B22").Select Selection.Font.Bold = False End If End Sub "JCanyoneer" wrote: This is probably simple but I cannot figure out the syntax. I have a few checkboxes on a sheet that I would like to have run a macro that would bold or unbold based on the value of the checkbox or its cell reference. I'm not sure if there is a better way than a macro or not. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! That is so much easier!
"Bob Phillips" wrote: too much code Sub Check2() Range("B22").Font.Bold = Range("A22").Value End Sub -- HTH RP "JCanyoneer" wrote in message ... Here's what I found that worked: Sub Check2() Range("A22").Select If ActiveCell.Value = "True" Then Range("B22").Select Selection.Font.Bold = True Else Range("B22").Select Selection.Font.Bold = False End If End Sub "JCanyoneer" wrote: This is probably simple but I cannot figure out the syntax. I have a few checkboxes on a sheet that I would like to have run a macro that would bold or unbold based on the value of the checkbox or its cell reference. I'm not sure if there is a better way than a macro or not. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"JCanyoneer" wrote in message ...
This is probably simple but I cannot figure out the syntax. I have a few checkboxes on a sheet that I would like to have run a macro that would bold or unbold based on the value of the checkbox or its cell reference. I'm not sure if there is a better way than a macro or not. You can use a macro, sure, or you can use Excel's built-in conditional formatting. As an example, create a new worksheet and put some True/False values in column D. Select column D, then go to Format | Conditional Formatting. For Condition 1, fill in the following information: First dropbox: "Formula Is" Text entry box: "=$D1=True" Click the Format button, select Bold. Click OK, click OK. That should do it. (These instructions are for Excel 2002, but it should be the same for XP) Note that you can only have three conditional formats in a worksheet at one time, so if you have something more complicated you may wish to use a macro. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Bolding text in a control text box. | Excel Discussion (Misc queries) | |||
Bolding when subtotalling | Excel Worksheet Functions | |||
Bolding with formulas and "if/thens" | Excel Worksheet Functions | |||
Bolding | Excel Programming | |||
Bolding specific text | Excel Programming |