Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I have a workbook with 30-40 different sheets, i have a command button on
each sheet that start a macro called Sub Producedwatersystem(). Is it possible that a form can appear at the same time as the workbook is opened? (a opening page). Is it possible that the user can choose what sheet to be active and start the macro from that form? |
#2
![]() |
|||
|
|||
![]()
Do you want the form to do anything, or just to flash up, a splash screen?
If the latter, see http://www.xldynamic.com/source/xld.xlFAQ0007.html How do you want the selection to be invoiced. -- HTH RP (remove nothere from the email address if mailing direct) "Mike" wrote in message ... I have a workbook with 30-40 different sheets, i have a command button on each sheet that start a macro called Sub Producedwatersystem(). Is it possible that a form can appear at the same time as the workbook is opened? (a opening page). Is it possible that the user can choose what sheet to be active and start the macro from that form? |
#3
![]() |
|||
|
|||
![]()
Hi Bob, thanks for helping me!
I dont want the form to do anything, But i want 2 command buttons on it, one called Cancel and one called New input, both of them shall hide the form and the last one should also start the macro assign to the worksheet "Bob Phillips" wrote: Do you want the form to do anything, or just to flash up, a splash screen? If the latter, see http://www.xldynamic.com/source/xld.xlFAQ0007.html How do you want the selection to be invoiced. -- HTH RP (remove nothere from the email address if mailing direct) "Mike" wrote in message ... I have a workbook with 30-40 different sheets, i have a command button on each sheet that start a macro called Sub Producedwatersystem(). Is it possible that a form can appear at the same time as the workbook is opened? (a opening page). Is it possible that the user can choose what sheet to be active and start the macro from that form? |
#4
![]() |
|||
|
|||
![]()
I would add a listbox, and two buttons to the form. The listbox will list
all the sheets, the buttons will be a Cancel and a New button. The userform code would then be Private Sub CommandButto2_Click() Unload Me End Sub Private Sub CommandButton1_Click() If Me.ListBox1.ListIndex = -1 Then MsgBox "Select a sheet" Else Worksheets(Me.ListBox1.Value).Activate Call myMacro Unload Me End If End Sub Private Sub UserForm_Activate() Dim sh As Worksheet With ActiveWorkbook For Each sh In .Worksheets Me.ListBox1.AddItem sh.Name Next sh End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Mike" wrote in message ... Hi Bob, thanks for helping me! I dont want the form to do anything, But i want 2 command buttons on it, one called Cancel and one called New input, both of them shall hide the form and the last one should also start the macro assign to the worksheet "Bob Phillips" wrote: Do you want the form to do anything, or just to flash up, a splash screen? If the latter, see http://www.xldynamic.com/source/xld.xlFAQ0007.html How do you want the selection to be invoiced. -- HTH RP (remove nothere from the email address if mailing direct) "Mike" wrote in message ... I have a workbook with 30-40 different sheets, i have a command button on each sheet that start a macro called Sub Producedwatersystem(). Is it possible that a form can appear at the same time as the workbook is opened? (a opening page). Is it possible that the user can choose what sheet to be active and start the macro from that form? |
#5
![]() |
|||
|
|||
![]()
Thanks Bob.
It works:-) "Bob Phillips" wrote: I would add a listbox, and two buttons to the form. The listbox will list all the sheets, the buttons will be a Cancel and a New button. The userform code would then be Private Sub CommandButto2_Click() Unload Me End Sub Private Sub CommandButton1_Click() If Me.ListBox1.ListIndex = -1 Then MsgBox "Select a sheet" Else Worksheets(Me.ListBox1.Value).Activate Call myMacro Unload Me End If End Sub Private Sub UserForm_Activate() Dim sh As Worksheet With ActiveWorkbook For Each sh In .Worksheets Me.ListBox1.AddItem sh.Name Next sh End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Mike" wrote in message ... Hi Bob, thanks for helping me! I dont want the form to do anything, But i want 2 command buttons on it, one called Cancel and one called New input, both of them shall hide the form and the last one should also start the macro assign to the worksheet "Bob Phillips" wrote: Do you want the form to do anything, or just to flash up, a splash screen? If the latter, see http://www.xldynamic.com/source/xld.xlFAQ0007.html How do you want the selection to be invoiced. -- HTH RP (remove nothere from the email address if mailing direct) "Mike" wrote in message ... I have a workbook with 30-40 different sheets, i have a command button on each sheet that start a macro called Sub Producedwatersystem(). Is it possible that a form can appear at the same time as the workbook is opened? (a opening page). Is it possible that the user can choose what sheet to be active and start the macro from that form? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assign Macro | Excel Discussion (Misc queries) | |||
Assign to macro missing | Excel Discussion (Misc queries) | |||
How to assign a macro to a commnd button | Excel Discussion (Misc queries) | |||
Assign Macro to button in Excel doesnt work Any ideas? | Excel Discussion (Misc queries) | |||
assign a macro to a control button | Excel Discussion (Misc queries) |