Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How can I reset an Excel form that has radio buttons.

using version 2003.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How can I reset an Excel form that has radio buttons.

Dim ctrl as Control
for each ctrl in Userform1.Controls
if typeof ctrl is MSforms.OptionButton then
ctrl.Value = False
end if
Next

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

using version 2003.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How can I reset an Excel form that has radio buttons.

I'm a newbie. I tried pasting the macro 'as is' and assigning a button. It
didn't work. What am I doing wrong?

"Tom Ogilvy" wrote:

Dim ctrl as Control
for each ctrl in Userform1.Controls
if typeof ctrl is MSforms.OptionButton then
ctrl.Value = False
end if
Next

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

using version 2003.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How can I reset an Excel form that has radio buttons.

I had a userform with three optionbuttons. I place a commandbutton on the
sheet (commandbutton2). I then double clicked on the command button (in the
vbe in design mode) and it took me to

Private Sub CommandButton2_click()

End sub

I then altered that code to:

Private Sub CommandButton2_Click()
Dim ctrl As Control
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSforms.OptionButton Then
ctrl.Value = False
End If
Next

End Sub

then I showed the userform and clicked one of the optionbuttons. I clicked
commandbutton2 and the optionbuttons were all unselected.

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

I'm a newbie. I tried pasting the macro 'as is' and assigning a button. It
didn't work. What am I doing wrong?

"Tom Ogilvy" wrote:

Dim ctrl as Control
for each ctrl in Userform1.Controls
if typeof ctrl is MSforms.OptionButton then
ctrl.Value = False
end if
Next

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

using version 2003.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How can I reset an Excel form that has radio buttons.

I get this error msg:
"User-defined type not defined"

"Tom Ogilvy" wrote:

I had a userform with three optionbuttons. I place a commandbutton on the
sheet (commandbutton2). I then double clicked on the command button (in the
vbe in design mode) and it took me to

Private Sub CommandButton2_click()

End sub

I then altered that code to:

Private Sub CommandButton2_Click()
Dim ctrl As Control
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSforms.OptionButton Then
ctrl.Value = False
End If
Next

End Sub

then I showed the userform and clicked one of the optionbuttons. I clicked
commandbutton2 and the optionbuttons were all unselected.

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

I'm a newbie. I tried pasting the macro 'as is' and assigning a button. It
didn't work. What am I doing wrong?

"Tom Ogilvy" wrote:

Dim ctrl as Control
for each ctrl in Userform1.Controls
if typeof ctrl is MSforms.OptionButton then
ctrl.Value = False
end if
Next

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

using version 2003.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How can I reset an Excel form that has radio buttons.

I had a userform with three optionbuttons. I place a commandbutton on the
sheet (commandbutton2). I then double clicked on the command button (in the
vbe in design mode) and it took me to

Private Sub CommandButton2_click()

End sub

I then altered that code to:

Private Sub CommandButton2_Click()
Dim ctrl As Control
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSforms.OptionButton Then
ctrl.Value = False
End If
Next

End Sub

then I showed the userform and clicked one of the optionbuttons. I clicked
commandbutton2 and the optionbuttons were all unselected.

--
Regards,
Tom Ogilvy

"JaxPM" wrote in message
...
I get this error msg:
"User-defined type not defined"

"Tom Ogilvy" wrote:

I had a userform with three optionbuttons. I place a commandbutton on

the
sheet (commandbutton2). I then double clicked on the command button (in

the
vbe in design mode) and it took me to

Private Sub CommandButton2_click()

End sub

I then altered that code to:

Private Sub CommandButton2_Click()
Dim ctrl As Control
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSforms.OptionButton Then
ctrl.Value = False
End If
Next

End Sub

then I showed the userform and clicked one of the optionbuttons. I

clicked
commandbutton2 and the optionbuttons were all unselected.

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

I'm a newbie. I tried pasting the macro 'as is' and assigning a

button. It
didn't work. What am I doing wrong?

"Tom Ogilvy" wrote:

Dim ctrl as Control
for each ctrl in Userform1.Controls
if typeof ctrl is MSforms.OptionButton then
ctrl.Value = False
end if
Next

--
Regards,
Tom Ogilvy


"JaxPM" wrote:

using version 2003.



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
Reset button code for Radio Buttons [email protected] Excel Discussion (Misc queries) 6 August 25th 12 03:09 PM
how do I get radio buttons in excel Jammings Excel Discussion (Misc queries) 4 June 30th 08 05:53 PM
add radio buttons to an excel document KENKYL Excel Worksheet Functions 1 May 10th 06 06:22 PM
active x radio buttons in excel Anna Excel Programming 4 June 16th 05 01:42 AM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 07:01 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"