Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi All, I have to dif. VBA short programs for calculating wt. conversion temp. conversion. As of now I have two different files to run thes programs. What I am trying to do is to use one user from with optio buttons to choose a program to run. how can I write the code to choos a specifice module when a button is sellected? Appreciate your help. Thanks Sye -- sazi ----------------------------------------------------------------------- saziz's Profile: http://www.excelforum.com/member.php...nfo&userid=635 View this thread: http://www.excelforum.com/showthread.php?threadid=47563 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Copy both of your macros into module sheet/s in the same workbook, I
have called them macro1 and macro2. Create your userform with two optionbuttons and a commandbutton. The code in the userform would then look something like this: Private Sub UserForm_Initialize() Me.OptionButton1 = True End Sub Private Sub CommandButton1_Click() If Me.OptionButton1 Then Call macro1 Else Call macro2 End If Unload.Me End Sub Hope this helps Rowan saziz wrote: Hi All, I have to dif. VBA short programs for calculating wt. conversion & temp. conversion. As of now I have two different files to run these programs. What I am trying to do is to use one user from with option buttons to choose a program to run. how can I write the code to choose a specifice module when a button is sellected? Appreciate your help. Thanks Syed |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Rowan, Thanks for your reply. I am trying to show userform1 or userform2, if a specific button is clicked. As you wrote to call macro how do I get to trigger module to show that specific userform? I hope I am clear enough. Thanks Syed -- saziz ------------------------------------------------------------------------ saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350 View this thread: http://www.excelforum.com/showthread...hreadid=475633 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code to load a userform is:
UserForm1.Show so if you are wanting this to run when a button (say commandbutton1) is clicked then maybe: Private Sub CommandButton1_Click() If Me.OptionButton1 Then userform1.show Else userform2.show End If Unload.Me End Sub Hope this helps Rowan saziz wrote: Hi Rowan, Thanks for your reply. I am trying to show userform1 or userform2, if a specific button is clicked. As you wrote to call macro how do I get to trigger module to show that specific userform? I hope I am clear enough. Thanks Syed |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing Strings from UserForm to Module | Excel Programming | |||
Textbox in Userform not recognised by Module | Excel Programming | |||
Passing variables from module to userform | Excel Programming | |||
Userform with template class module problem | Excel Programming | |||
Delete userform/module using VB | Excel Programming |