Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Copying OptionButtons

Hey there,

I've been copying my spreadsheets and all the active controls seem to
work fine except the option buttons. Everytime I click on a button
from my old sheet, the selected option disappears from my new sheet.
Does anyone know why this might be the case?

I tried changing the names of the option buttons and then the names in
the codes but that didn't work and the only thing that seemed to was
when I drew new option buttons and reprogrammed everything.

Is there an easier way around this than having to draw new option
buttons each time?

Thanks!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copying OptionButtons

Each optionbutton has a .groupname property.

You'll want to give each group of optionbuttons a nice unique name.

show the control toolbox toolbar
click on the design mode icon
Rightclick on each option button
change the groupname on each sheet (or for each group on each sheet) to
something unique
turn off the design mode

And test it out.


samela wrote:

Hey there,

I've been copying my spreadsheets and all the active controls seem to
work fine except the option buttons. Everytime I click on a button
from my old sheet, the selected option disappears from my new sheet.
Does anyone know why this might be the case?

I tried changing the names of the option buttons and then the names in
the codes but that didn't work and the only thing that seemed to was
when I drew new option buttons and reprogrammed everything.

Is there an easier way around this than having to draw new option
buttons each time?

Thanks!!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Copying OptionButtons

On Jan 11, 11:10*pm, Dave Peterson wrote:
Each optionbutton has a .groupname property.

You'll want to give each group of optionbuttons a nice unique name.

show the control toolbox toolbar
click on the design mode icon
Rightclick on each option button
change the groupname on each sheet (or for each group on each sheet) to
something unique
turn off the design mode

And test it out.





samela wrote:

Hey there,


I've been copying my spreadsheets and all the active controls seem to
work fine except the option buttons. Everytime I click on a button
from my old sheet, the selected option disappears from my new sheet.
Does anyone know why this might be the case?


I tried changing the names of the option buttons and then the names in
the codes but that didn't work and the only thing that seemed to was
when I drew new option buttons and reprogrammed everything.


Is there an easier way around this than having to draw new option
buttons each time?


Thanks!!


--

Dave Peterson- Hide quoted text -

- Show quoted text -



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?
  #4   Report Post  
Posted to microsoft.public.excel.programming
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
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
more than two optionbuttons in a group Stefi Excel Programming 4 November 3rd 06 10:41 AM
OptionButtons Paul Excel Programming 4 December 4th 03 04:12 PM
Add OptionButtons in Excel Andrew Lenczycki Excel Programming 0 July 30th 03 02:34 PM
optionbuttons Phil Perry Excel Programming 1 July 10th 03 09:13 PM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"