View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Copying OptionButtons

Not that I know of.

But you could use a macro to change the groupnames in each worksheet to the
worksheet's name.

This'll use the codename of the worksheet.

Option Explicit
Sub testme()

Dim myOptBtn As OLEObject
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
For Each myOptBtn In wks.OLEObjects
If TypeOf myOptBtn.Object Is MSForms.OptionButton Then
myOptBtn.Object.GroupName = wks.CodeName
End If
Next myOptBtn
Next wks
End Sub


Don't use this if you have optionbuttons that are in different groups on the
same sheet. It'll put all the optionbuttons on the sheet in one group.



samela wrote:

Thanks, Dave :)

Is there a way to get the change to be automatic with each new sheet I
copy? Instead of having to change each of the GroupName(s) manually
each time I work with a new sheet?


--

Dave Peterson