Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default UserForms: Clear all Option Buttons

I have a file that uses several userforms. These userforms have several
option buttons and check boxes on each.


During "UserForm_Activate()" what code will clear all option buttons and
check boxes at once?

--
Thanks
Shawn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default UserForms: Clear all Option Buttons

This won't work?

Sub ClearOptButChBx()

Dim usf As UserForm
Dim OLEObj As OLEObject

Set usf = ActiveUserForm

For Each OLEObj In usf.OLEObjects
If TypeOf OLEObj.Object Is MSForms.CheckBox Or TypeOf OLEObj.Object
Is MSForms.OptionButton Then
OLEObj.Object.Value = False
End If
Next OLEObj

End Sub


--
Thanks
Shawn


"Shawn" wrote:

I have a file that uses several userforms. These userforms have several
option buttons and check boxes on each.


During "UserForm_Activate()" what code will clear all option buttons and
check boxes at once?

--
Thanks
Shawn

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default UserForms: Clear all Option Buttons

Instead of setting the userform to "hide" I "unload" it. That seems to do
the trick.
--
Thanks
Shawn


"Shawn" wrote:

This won't work?

Sub ClearOptButChBx()

Dim usf As UserForm
Dim OLEObj As OLEObject

Set usf = ActiveUserForm

For Each OLEObj In usf.OLEObjects
If TypeOf OLEObj.Object Is MSForms.CheckBox Or TypeOf OLEObj.Object
Is MSForms.OptionButton Then
OLEObj.Object.Value = False
End If
Next OLEObj

End Sub


--
Thanks
Shawn


"Shawn" wrote:

I have a file that uses several userforms. These userforms have several
option buttons and check boxes on each.


During "UserForm_Activate()" what code will clear all option buttons and
check boxes at once?

--
Thanks
Shawn

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
clear option buttons **MACRO TWEAK** Dan Excel Programming 4 February 19th 07 05:34 PM
Option buttons: How to get the selected option from a group? naddad Excel Programming 5 December 21st 05 05:09 PM
Userforms submit button to clear after it enters data? carlaruge[_2_] Excel Programming 2 July 8th 05 01:50 AM
Navigating between option buttons is not selecting the option drhalter Excel Programming 1 June 3rd 05 02:28 PM
Navigating between option buttons is not selecting the option Gixxer_J_97[_2_] Excel Programming 4 June 2nd 05 02:50 PM


All times are GMT +1. The time now is 12:21 PM.

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"