ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bolding text using a check box (https://www.excelbanter.com/excel-programming/315143-bolding-text-using-check-box.html)

JCanyoneer

Bolding text using a check box
 
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.

JCanyoneer

Bolding text using a check box
 
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.


Bob Phillips[_6_]

Bolding text using a check box
 
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.




JCanyoneer

Bolding text using a check box
 
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.





Nathan Strom

Bolding text using a check box
 
"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.


All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com