Hello,
I have a radio button in my VBA userform. I want to link this radio button to a Option button in Sheet1. I think you do it via the control source bu when i type
it doesnt workPlease Login or Register to view this content.
Hello,
I have a radio button in my VBA userform. I want to link this radio button to a Option button in Sheet1. I think you do it via the control source bu when i type
it doesnt workPlease Login or Register to view this content.
This is from the VBA help for ControlSource Property
ControlSource Property
Identifies the data location used to set or store the Value property of a control. The ControlSource property accepts worksheet ranges from Microsoft Excel.
Syntax
object.ControlSource [= String]
The ControlSource property syntax has these parts:
Part Description
object Required. A valid object.
String Optional. Specifies the worksheet cell linked to the Value property of a control.
Remarks
The ControlSource property identifies a cell or field; it does not contain the data stored in the cell or field. If you change the Value of the control, the change is automatically reflected in the linked cell or field. Similarly, if you change the value of the linked cell or field, the change is automatically reflected in the Value of the control.
You cannot specify another control for the ControlSource. Doing so causes an error.
The default value for ControlSource is an empty string. If ControlSource contains a value other than an empty string, it identifies a linked cell or field. The contents of that cell or field are automatically copied to the Value property when the control is loaded.
Set both option buttons (userform and worksheet) control sources to the same cell address e.g. Sheet1!A1
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Hi buwa84,
Thank you AlphaFrog for introducing me to the ControlSource Property
The control source property does not apply to a single option button in a Spreadsheet, but to the group: http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx
Having said that I was unsuccessful linking any Worksheet 'Active X' control using ControlSource.
However I was successful using ControlSource with UserForm Option Buttons.
To link UserForm Option Buttons to a cell (please note this is bi-directional):
LewisPlease Login or Register to view this content.
I was successful in making UserForm Option Buttons control Forms Options Buttons and 'Active X' Option Buttons on the worksheet.
In the UserForm code module:
LewisPlease Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks