Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selection of UserForm through button


Hi All,
I have this code working for selecting a userform:

Private Sub CommandButton1_Click()
If Button = OptionButton1 Then

UserForm1.Show

ElseIf Button = OptionButton2 Then
UserForm2.Show
End If

End Sub




Now I want to add a 3rd. button. I tried inserting another if
statement but it does not show my new user form.

Any help would be apreicated
Thanks
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=492924

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default Selection of UserForm through button

Can you post the code that is not working?

Alok

"saziz" wrote:


Hi All,
I have this code working for selecting a userform:

Private Sub CommandButton1_Click()
If Button = OptionButton1 Then

UserForm1.Show

ElseIf Button = OptionButton2 Then
UserForm2.Show
End If

End Sub




Now I want to add a 3rd. button. I tried inserting another if
statement but it does not show my new user form.

Any help would be apreicated
Thanks
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=492924


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selection of UserForm through button


Hi alok,
Here is the code:

Private Sub CommandButton1_Click()
If Button = OptionButton1 Then
UserForm1.Show
End If
If Button = OptionButton2 Then
UserForm2.Show
End If
If Button = optionbutton4 Then
UserForm4.Show
End If

End Sub

What is happening is when I select a button, it shows all 3 userforms
one by one.
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=492924

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Selection of UserForm through button

Hi Saziz

Try:

'=============
Private Sub CommandButton1_Click()
If OptionButton1 Then
UserForm1.Show
ElseIf OptionButton2 Then
UserForm2.Show
ElseIf OptionButton4 Then
UserForm4.Show
End If
End Sub
'<<=============

---
Regards,
Norman



"saziz" wrote in
message ...

Hi alok,
Here is the code:

Private Sub CommandButton1_Click()
If Button = OptionButton1 Then
UserForm1.Show
End If
If Button = OptionButton2 Then
UserForm2.Show
End If
If Button = optionbutton4 Then
UserForm4.Show
End If

End Sub

What is happening is when I select a button, it shows all 3 userforms
one by one.
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile:
http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=492924



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selection of UserForm through button


Norman,
Thanks, your code worked fine.
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=492924



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
Display a selection while UserForm is in focus [email protected] Excel Programming 0 October 7th 05 01:20 AM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Print - Userform Multipage selection Sagaron Excel Programming 2 June 26th 05 02:42 PM
selection all textboxes in userform at once Marthijn Beusekom via OfficeKB.com Excel Programming 2 February 19th 05 01:08 AM
Date Selection Userform Archie[_2_] Excel Programming 2 April 13th 04 07:05 AM


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