Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bolding text in a control text box. AJL Excel Discussion (Misc queries) 3 November 16th 06 05:39 PM
Bolding when subtotalling mrsteve1 Excel Worksheet Functions 2 February 17th 05 11:26 PM
Bolding with formulas and "if/thens" Abi Excel Worksheet Functions 4 January 11th 05 10:44 PM
Bolding Dale[_12_] Excel Programming 2 September 30th 04 04:21 PM
Bolding specific text Scot Rundell Excel Programming 2 September 15th 03 07:20 AM


All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"