ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Quick syntax question- bolding userform control text via VBA (https://www.excelbanter.com/excel-programming/380719-quick-syntax-question-bolding-userform-control-text-via-vba.html)

Keith

Quick syntax question- bolding userform control text via VBA
 
When I try to bold the text on a checkbox on my userform:

UserForm1.chk_A.font.fontstyle = "Bold"

(actually, my real code is:
UserForm1.Controls("cb_" & RowID).Font.FontStyle = "Bold"

I get a 438 error, doesnt support this property or method. A google search
find plenty of references to worksheet fontstyles (in which case I would
just use the macro recorder to get the syntax), but so far nothing on
bolding a control's text. I need to do this dynamically based on user
selections, otherwise I would just set it in the properties.

The control reference is good, because
UserForm1.Controls("cb_" & RowID).Value = True
works fine.

Any assistance would be greatly appreciated.
Thanks!
Keith



Corey

Quick syntax question- bolding userform control text via VBA
 
have tried:
UserForm1.Controls("cb_" & RowID).Font.Bold=TRUE
"Keith" wrote in message
...
When I try to bold the text on a checkbox on my userform:

UserForm1.chk_A.font.fontstyle = "Bold"

(actually, my real code is:
UserForm1.Controls("cb_" & RowID).Font.FontStyle = "Bold"

I get a 438 error, doesnt support this property or method. A google search
find plenty of references to worksheet fontstyles (in which case I would
just use the macro recorder to get the syntax), but so far nothing on
bolding a control's text. I need to do this dynamically based on user
selections, otherwise I would just set it in the properties.

The control reference is good, because
UserForm1.Controls("cb_" & RowID).Value = True
works fine.

Any assistance would be greatly appreciated.
Thanks!
Keith




Keith

Quick syntax question- bolding userform control text via VBA
 
That's got it-
Thanks Corey!

"Corey" wrote in message
...
have tried:
UserForm1.Controls("cb_" & RowID).Font.Bold=TRUE
"Keith" wrote in message
...
When I try to bold the text on a checkbox on my userform:

UserForm1.chk_A.font.fontstyle = "Bold"

(actually, my real code is:
UserForm1.Controls("cb_" & RowID).Font.FontStyle = "Bold"

I get a 438 error, doesnt support this property or method. A google
search find plenty of references to worksheet fontstyles (in which case I
would just use the macro recorder to get the syntax), but so far nothing
on bolding a control's text. I need to do this dynamically based on user
selections, otherwise I would just set it in the properties.

The control reference is good, because
UserForm1.Controls("cb_" & RowID).Value = True
works fine.

Any assistance would be greatly appreciated.
Thanks!
Keith







All times are GMT +1. The time now is 12:31 PM.

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