ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Option button caption (https://www.excelbanter.com/excel-programming/308087-option-button-caption.html)

Buce Roberson

Option button caption
 
Since the caption's label is what a user sees when they
pull up a form and look at an option button, I need to
know if there is a way to have that caption name be able
to change itself based on an cell entry.

In other words, if cell A1 contains the text I want on the
caption, I would want the user to be able to type
something else in that cell and then have the form
automatically change the name on the caption so that the
user sees what they typed in the cell A1 without having to
teach the user to go in there and make changes to a form.

Hopefully this description makes sense.


Tom Ogilvy

Option button caption
 
Private Sub Userform_Initialize()
Dim rng as Range
set rng = Worksheets("Sheet1").Range("A1")
if not isempty(rng) then
label1.caption = rng.Text
End if
End Sub

--
Regards,
Tom Ogilvy

"Buce Roberson" wrote in message
...
Since the caption's label is what a user sees when they
pull up a form and look at an option button, I need to
know if there is a way to have that caption name be able
to change itself based on an cell entry.

In other words, if cell A1 contains the text I want on the
caption, I would want the user to be able to type
something else in that cell and then have the form
automatically change the name on the caption so that the
user sees what they typed in the cell A1 without having to
teach the user to go in there and make changes to a form.

Hopefully this description makes sense.





All times are GMT +1. The time now is 04:52 AM.

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