using version 2003.
using version 2003.
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.
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.
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.
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.
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" <JaxPM@discussions.microsoft.com> wrote in message
news:28BB9104-99D9-41E5-8E1B-CD7D013BE729@microsoft.com...
> 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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks