Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK this does not sound very difficult but I have a problem finding the
correct macro and how to connect it to the button. I have made a button from the ViewToolbarsForms in Excel. Now I already have code that I have placed in a Modul. The only thing I want the button to do is to call a bigger program that is found in the modul when pressed. When I try to connect the button to desierd macro I do not succed to find the macro in the lis nor do any manual attempts work. Can someone please help me? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Right click on the button, click on View Code. You will see a procedure,
most likely called Button1_Click(), with a blank line below that, and in the next line the words End Sub. In the blank line type in the name of the macro you want to run. Return to your sheet, and click on the Design button to exit Edit mode. If you click the button, it will run your macro. "april27" wrote: OK this does not sound very difficult but I have a problem finding the correct macro and how to connect it to the button. I have made a button from the ViewToolbarsForms in Excel. Now I already have code that I have placed in a Modul. The only thing I want the button to do is to call a bigger program that is found in the modul when pressed. When I try to connect the button to desierd macro I do not succed to find the macro in the lis nor do any manual attempts work. Can someone please help me? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I coded a VBA Excel solution where a UserForm shows when the Workbook_Open
occurs. Once the process finishes successfully, the workbook stays open with a button on the worksheet. It is in the worksheet, not the module, where your code goes. So, for instance, my Workbook_Open is this: Private Sub Workbook_Open() UserForm_HSIsplash.Show UserForm1.Show End Sub And the code for the button click on the Worksheet (I named the button "showUserForm1") is this: Private Sub showUserForm1_Click() Call UserForm1.UserForm_Initialize UserForm1.Show End Sub Hope this helps! -- --Being powerful is like being a lady; if you have to tell people you are, you aren''t. ~~Margaret Thatcher "april27" wrote: OK this does not sound very difficult but I have a problem finding the correct macro and how to connect it to the button. I have made a button from the ViewToolbarsForms in Excel. Now I already have code that I have placed in a Modul. The only thing I want the button to do is to call a bigger program that is found in the modul when pressed. When I try to connect the button to desierd macro I do not succed to find the macro in the lis nor do any manual attempts work. Can someone please help me? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Are you able to run the macro with menu Tools Macro Run ? Which module is the macro in ? Best wishes Harald "april27" skrev i melding ... OK this does not sound very difficult but I have a problem finding the correct macro and how to connect it to the button. I have made a button from the ViewToolbarsForms in Excel. Now I already have code that I have placed in a Modul. The only thing I want the button to do is to call a bigger program that is found in the modul when pressed. When I try to connect the button to desierd macro I do not succed to find the macro in the lis nor do any manual attempts work. Can someone please help me? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Press <Alt<F11 to go to VB. Find the macro you want to use, and remember
this name. It could be in a module of its own - Module 1 most likely, or in This Workbook, or one of the worksheets. To move between these, double click on the name in the left hand window, and you will see code if any in the right hand window. Also, you should use View Toolbars Control Toolbox to create a button. Once you have the name of the macro, do as per my previous post. Kassie "april27" wrote: OK this does not sound very difficult but I have a problem finding the correct macro and how to connect it to the button. I have made a button from the ViewToolbarsForms in Excel. Now I already have code that I have placed in a Modul. The only thing I want the button to do is to call a bigger program that is found in the modul when pressed. When I try to connect the button to desierd macro I do not succed to find the macro in the lis nor do any manual attempts work. Can someone please help me? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel in macro and connecting to a network drive question | Excel Discussion (Misc queries) | |||
Macro Error When Connecting to Hidden Sheet | Excel Discussion (Misc queries) | |||
Can't select macro button after other button is pressed | Excel Programming | |||
Pause macro, add form button to sheet, continue macro when button clicked! | Excel Programming | |||
Connecting to Access using macro | Excel Programming |