ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Radio buttons in group box -- linked cell (https://www.excelbanter.com/excel-programming/427423-radio-buttons-group-box-linked-cell.html)

dgold82

Radio buttons in group box -- linked cell
 
I have about 200 separate group boxes with different numbers of radio buttons
in them. I am now at the point where I need to link each set of radio buttons
within each box to a specific cell. Is there an easy way of doing this
without having to select each each button and pointing them? I have about 4
buttons in each group box so I have been selecting 4 at a time and right
clicking to point and would rather not have to repeat that over 200 times.

Thanks.

Trevor Williams

Radio buttons in group box -- linked cell
 
Hi dgold82

Try this... It will link each Option Button to the top left cell of the
groupbox it is in.

Sub LinkOptBtns()
Dim GrpBox As GroupBox
Dim OptBtn As OptionButton
For Each OptBtn In ActiveSheet.OptionButtons
With OptBtn
.LinkedCell = .GroupBox.TopLeftCell.Address
End With
Next
End Sub

HTH
Trevor Williams

"dgold82" wrote:

I have about 200 separate group boxes with different numbers of radio buttons
in them. I am now at the point where I need to link each set of radio buttons
within each box to a specific cell. Is there an easy way of doing this
without having to select each each button and pointing them? I have about 4
buttons in each group box so I have been selecting 4 at a time and right
clicking to point and would rather not have to repeat that over 200 times.

Thanks.


dgold82

Radio buttons in group box -- linked cell
 
Interesting, I'll give it a try. I was actually hoping to put them down a
specific column--say D1:D200. But now that I think about it how would I know
which group went to which cell in colomn "D"?

"Trevor Williams" wrote:

Hi dgold82

Try this... It will link each Option Button to the top left cell of the
groupbox it is in.

Sub LinkOptBtns()
Dim GrpBox As GroupBox
Dim OptBtn As OptionButton
For Each OptBtn In ActiveSheet.OptionButtons
With OptBtn
.LinkedCell = .GroupBox.TopLeftCell.Address
End With
Next
End Sub

HTH
Trevor Williams

"dgold82" wrote:

I have about 200 separate group boxes with different numbers of radio buttons
in them. I am now at the point where I need to link each set of radio buttons
within each box to a specific cell. Is there an easy way of doing this
without having to select each each button and pointing them? I have about 4
buttons in each group box so I have been selecting 4 at a time and right
clicking to point and would rather not have to repeat that over 200 times.

Thanks.


dgold82

Radio buttons in group box -- linked cell
 
Nevermind. It worked amazingly! Thank you!

"Trevor Williams" wrote:

Hi dgold82

Try this... It will link each Option Button to the top left cell of the
groupbox it is in.

Sub LinkOptBtns()
Dim GrpBox As GroupBox
Dim OptBtn As OptionButton
For Each OptBtn In ActiveSheet.OptionButtons
With OptBtn
.LinkedCell = .GroupBox.TopLeftCell.Address
End With
Next
End Sub

HTH
Trevor Williams

"dgold82" wrote:

I have about 200 separate group boxes with different numbers of radio buttons
in them. I am now at the point where I need to link each set of radio buttons
within each box to a specific cell. Is there an easy way of doing this
without having to select each each button and pointing them? I have about 4
buttons in each group box so I have been selecting 4 at a time and right
clicking to point and would rather not have to repeat that over 200 times.

Thanks.



All times are GMT +1. The time now is 05:14 PM.

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