ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assigning Different Caption to a Check Box (https://www.excelbanter.com/excel-programming/284512-assigning-different-caption-check-box.html)

ed

Assigning Different Caption to a Check Box
 
How do I use VBA to assign a different caption name to a
check box?

GJones

Assigning Different Caption to a Check Box
 
Ed;

You cannot dynamically change the caption for a check
box. What you could do is to leave the caption blank and
use more than one label and then make the correct one
visible and the rest not visible.

Thanks,

Greg


-----Original Message-----
How do I use VBA to assign a different caption name to a
check box?
.


Chip Pearson

Assigning Different Caption to a Check Box
 
Ed,

Are this a check box on a userform? If so, use

Userform1.Checkbox1.Caption = "New Caption"

If the check box is on a worksheet, and comes from the Controls
command bar, use

Worksheets("Sheet1").OLEObjects("CheckBox1").Objec t.Caption =
"New Caption"

If the checkbox is on a worksheet, and comes from the Forms
command bar, use

Worksheets("Sheet1").CheckBoxes(1).Caption = "New Text"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Ed" wrote in message
...
How do I use VBA to assign a different caption name to a
check box?




No Name

Assigning Different Caption to a Check Box
 
Thanks. Can I hide and show the check box using VB?

-----Original Message-----
Ed;

You cannot dynamically change the caption for a check
box. What you could do is to leave the caption blank

and
use more than one label and then make the correct one
visible and the rest not visible.

Thanks,

Greg


-----Original Message-----
How do I use VBA to assign a different caption name to

a
check box?
.

.


ed

Assigning Different Caption to a Check Box
 
Awesome! Thanks.

-----Original Message-----
Ed,

Are this a check box on a userform? If so, use

Userform1.Checkbox1.Caption = "New Caption"

If the check box is on a worksheet, and comes from the

Controls
command bar, use

Worksheets("Sheet1").OLEObjects

("CheckBox1").Object.Caption =
"New Caption"

If the checkbox is on a worksheet, and comes from the

Forms
command bar, use

Worksheets("Sheet1").CheckBoxes(1).Caption = "New Text"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Ed" wrote in

message
...
How do I use VBA to assign a different caption name to

a
check box?



.


Tom Ogilvy

Assigning Different Caption to a Check Box
 
What makes you think you can't programmatically change the caption of a
checkbox. That just isn't true.

--
Regards,
Tom Ogilvy

GJones wrote in message
...
Ed;

You cannot dynamically change the caption for a check
box. What you could do is to leave the caption blank and
use more than one label and then make the correct one
visible and the rest not visible.

Thanks,

Greg


-----Original Message-----
How do I use VBA to assign a different caption name to a
check box?
.





All times are GMT +1. The time now is 05:15 AM.

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