Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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
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
Text box does not populate linked cell Joe Wildman[_2_] Excel Worksheet Functions 2 February 15th 09 03:55 PM
text box linked to cell DJP Excel Worksheet Functions 1 November 1st 06 07:20 AM
Text in cell is cut off when linked to another WS CMIConnie Excel Discussion (Misc queries) 0 May 5th 06 07:48 PM
Text Colour In Linked Cell [email protected] Excel Discussion (Misc queries) 1 April 5th 06 06:59 AM
Text Box Linked To Cell denise Excel Discussion (Misc queries) 1 September 26th 05 05:40 PM


All times are GMT +1. The time now is 07:55 AM.

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"