Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option box text - linked to cell
I have several option boxes that are contained within a group box. I would
like the 'text' that appears within each option box to be linked to a specific cell. For example if we have option boxes 1 thru 10, I may have a table containing names in cells A1 thru A10. Option box 1 text would be linked to cell A1, option box 2 would be linked to A2, etc. This would allow the option box 'text' to change if the descriptions in the table change. Is there a simple way to accomplish this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option box text - linked to cell
Depending on where your Option Buttons Are Either of these should do it
'If On a worksheet Private Sub Workbook_Open() With Worksheets(1) .OptionButton1.Caption = Worksheets(1).Range("A1") .OptionButton2.Caption = Worksheets(1).Range("A2") .OptionButton3.Caption = Worksheets(1).Range("A3") End With End Sub ------------Or---------------- 'If on a UserForm Private Sub UserForm_Initialize() With UserForm1 .OptionButton1.Caption = Worksheets(1).Range("A1") .OptionButton2.Caption = Worksheets(1).Range("A2") .OptionButton3.Caption = Worksheets(1).Range("A3") End With End Sub "jday" wrote: I have several option boxes that are contained within a group box. I would like the 'text' that appears within each option box to be linked to a specific cell. For example if we have option boxes 1 thru 10, I may have a table containing names in cells A1 thru A10. Option box 1 text would be linked to cell A1, option box 2 would be linked to A2, etc. This would allow the option box 'text' to change if the descriptions in the table change. Is there a simple way to accomplish this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option box text - linked to cell
Worked perfectly! Thanks for your help.
"Jeff" wrote: Depending on where your Option Buttons Are Either of these should do it 'If On a worksheet Private Sub Workbook_Open() With Worksheets(1) .OptionButton1.Caption = Worksheets(1).Range("A1") .OptionButton2.Caption = Worksheets(1).Range("A2") .OptionButton3.Caption = Worksheets(1).Range("A3") End With End Sub ------------Or---------------- 'If on a UserForm Private Sub UserForm_Initialize() With UserForm1 .OptionButton1.Caption = Worksheets(1).Range("A1") .OptionButton2.Caption = Worksheets(1).Range("A2") .OptionButton3.Caption = Worksheets(1).Range("A3") End With End Sub "jday" wrote: I have several option boxes that are contained within a group box. I would like the 'text' that appears within each option box to be linked to a specific cell. For example if we have option boxes 1 thru 10, I may have a table containing names in cells A1 thru A10. Option box 1 text would be linked to cell A1, option box 2 would be linked to A2, etc. This would allow the option box 'text' to change if the descriptions in the table change. Is there a simple way to accomplish this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text box does not populate linked cell | Excel Worksheet Functions | |||
text box linked to cell | Excel Worksheet Functions | |||
Text in cell is cut off when linked to another WS | Excel Discussion (Misc queries) | |||
Text Colour In Linked Cell | Excel Discussion (Misc queries) | |||
Text Box Linked To Cell | Excel Discussion (Misc queries) |