Run Macro That Applies To Other Macros
Apr 23, 2014
So I have a macro that sends an email of the active spread sheet. I want to add that macro to another macro. The tricky part is that i call other macros inside the macro. So is there a way i can add the send email macro and have it apply to all the macros i call. Here my code:
Code:
Sub Run_All_Billing()
'
' Run_All_Phones Macro
' Make sure you open "gateway.csv" "phone.csv" "ctiroutepoint.csv" and "Billing Contact.xls"
' Call Gateway Workbook and clean it up
Windows("gateway.csv").Activate
Call Clean_Up_Gateway
' Call Phone Workbook and clean it up
[Code] .........
Here's my send email Macro
Code:
Sub Send_Email()
'
' Send_Email Macro
'
Dim oApp, oMail As Object
Dim WB As Workbook
Dim ArchiveFolder As String, FileName As String
[Code] ........
So I want to add that send email macro into my Run all billing macro and it apply to all the macros I call.
View 2 Replies
ADVERTISEMENT
Mar 21, 2008
I am trying to write some code that is linked to a Command button. The code in the command button is in my workbook called "MF Consolidated ACTUAL DAILY REPORT - Dev.xls" but then I have another workbook called "MF BANK EXPOSURE SUMMARY.xls" that I want to do some work with - namely delete blank columns and it is here that I am having the problem.
My problem is this: my code module is contained in my project "MF Consolidated ACTUAL DAILY REPORT - Dev.xls" and the columns that I want deleted are in the "MF BANK EXPOSURE SUMMARY.xls". Now even though I believe I have activated the "MF BANK EXPOSURE SUMMARY.xls" workbook the action, that of deleting the blank columns is performed on the "MF Consolidated ACTUAL DAILY REPORT - Dev.xls" workbook. Why?? Here is the code that I am using:
Sub Commandbutton()
'ASK FOR DATE AND SET IT IN THE REPORT
Workbooks("MF Consolidated ACTUAL DAILY REPORT - Dev.xls").Worksheets _
("Seg and Non Seg Bank Summary"). Range("I1") = Application.InputBox("PLEASE ENTER REPORT DATE IN THE DD/MM/YYYY FORMAT")
'ACTIVATE MF BANK EXPOSURE SUMMARY
Workbooks("MF BANK EXPOSURE SUMMARY.xls"). Sheets("Seg and Non Seg").Activate
Dim iCol As Integer
Dim Isheet As Integer
With ActiveSheet.UsedRange................
View 3 Replies
View Related
Jan 14, 2008
is it possible to have a sheet that i can type in formulae and the formulae will automatically copy itself into the same cells on any new sheets i open?
View 13 Replies
View Related
Jul 9, 2012
I have some VBA code that formats my sheets and works fine, but the issue is that I run this same piece of code more than once in different sheets with the only difference being the formula references a different cell.
' Green Cells indicate that the supervision is within the year
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=Datedif(D8,today(),""m"")
View 4 Replies
View Related
Mar 27, 2009
Line 1 - Dim IRow As Long means...yada yada yada.
I know that I can look up "Dim" and "Dim what" and "IRow" etc, but need to know how it applies in the "real world" application/spreadsheet.
View 2 Replies
View Related
Jul 16, 2007
I have written two VBA programs around the same time. Both run on open and pull external data and create graphs. My problem is that I want the end user to be able to run the report multiple times by choosing the name of the macro from the Excel macro menu (i.e. Tools>Macro>Macros) but only one of the workbook macros shows up on the menu. why the other macro is not visible on this menu???
View 2 Replies
View Related
Oct 14, 2009
I have 5 macros that update/gather info from the net, and instead of running each of these individually, i would like to be able to create 1 super-macro that runs them all. How would i go about doing this?.. say they're called M1, M2.. M5..
View 2 Replies
View Related
Feb 21, 2013
I have several commonly used macros saved in my personal.xlsm file so I can tap into the power of these macros on all spreadsheets without having to re-create the macros in every worksheet I do.
The problem I have is that it's slow to recall these macros by clicking on the Developer-->Macros button. I'd much rather assign a hotkey to each...but the Hotkeys only work with ctrl+letter and I find that I accidentally assign my macros to hotkeys that are already hotkeys (example: ctrl+z for undo).
How can I create a macro that gives me a pop-up box with buttons I can push to activate the macro I need and then the pop-up box goes away after selecting the macro (something like a message box pop-up)?
View 2 Replies
View Related
Jan 28, 2010
Is there any way to nest a macro within another macro?
I have a macro inside of a module, and when the user clicks on a button to invoke that macro, it does some calculations, and then I need it to call another macro within the same module to do some calculations on another sheet.
View 2 Replies
View Related
Jul 24, 2007
I need to write a macros that will activate another macros whenever the cell "I4" is modified. So far it is not working the way it suppose to. Maybe anyone can spot a mistake? Here are both Macros that I have: ....
View 9 Replies
View Related
Jan 17, 2009
I am having a problem trying to create a macro that will loop in order to create several macros. I have a long macro (call it mainmacro) that needs to be able to create several simple macros to be used by the user of the workbook. Each macro has a variable that needs to be taken from mainmacro. Each macro is different based on the value of the 'i' loop variable that the macro is created in. i'm sure im making this sound more complicated than it really is...basically:
Sub mainmacro()
'lots of code not relavent to this issue here
For i = 1 to 10
'create 10 macros that, when run, would highlight A1, A2, etc.
Range("A" & i).Select
Next i
End Sub
This is just an example. But, basically, i just want to be able to automatically create a bunch of macros with a variable from mainmacro.!
View 11 Replies
View Related
Oct 23, 2006
I am trying to use the EnableMacros. zip script located here {url} But I am having a hard time making it work!
1. I have copied the module in EnableMacros.zip and imported it into my workbook.
2. I have placed identical code in my workbook's ThisWorkbook as is in the EnableMacros.zip's ThisWorkbook.
3. I have copied Sheet1 from EnableMacros.zip titled "Info Sheet". In MY workbook it is sheet7, but it is titled the "Info Sheet" in the EnableMacros.zip.
4. I have also copied sheet6 from EnableMacros.zip into my workbook and titled it "LoadScreen". In EnableMacros.zip the sheet is titled "Sheet1"
...
View 4 Replies
View Related
Nov 28, 2012
I have 5 macros to be run in sequence. I have copied them into the file attached with ----- line as separator between them.
How can I possibly combine them all into ONE MACRO?
View 5 Replies
View Related
Apr 3, 2009
Everytime I open the excel file I am working on I get a message saying that the file contains macros.
I have deleted all the macros I could find under "Tools" and "Macros" but I still get Module1.sortie, sortie and sortie listed. I can delete Module1.sortie but for the other two, sortie and sortie, I only have the "cancel" and "create" options.
View 14 Replies
View Related
Feb 2, 2012
I have several macros that import several files.
I'd like to create one macro that runs all the other macros. The sample below works by running Import_01 and Import_02
Code:
Application.Run "'FY13 Budget Worksheet - 400 Student Affairs - BACKUP.xlsm'!Import_01"
Application.Run "'FY13 Budget Worksheet - 400 Student Affairs - BACKUP.xlsm'!Import_02"
The problem is this filename may change. I'd like to remove the reference to 'FY13 Budget Worksheet - 400 Student Affairs - BACKUP.xlsm' so that the above code will work should the user change the filename.
View 2 Replies
View Related
Oct 23, 2006
I accidently put the Application.Quit command in the wrong place. Now Excel closes immediately when the macro executes. I can get into Excel if I disable the macro, but then it won't let me edit the macro. Is there a way to edit my macro without executing it?
View 7 Replies
View Related
Dec 17, 2006
I am trying to come up with some code to loop through all worksheets in the workbook and remve assigned macros from any buttons on each sheet
My code below. I type btn. and reviewed the items offered by intellisense, but nothing seemed fitting.
Sub RemoveAssignedMacro()
Dim wb As Workbook
Dim btn As Shape
Dim sht As Worksheet
Set wb = ThisWorkbook
For Each sht In wb.Worksheets
For Each btn In sht.Shapes
btn.
Next btn
Next sht
End Sub
View 8 Replies
View Related
Aug 26, 2009
I have an Excel 2003 program that contains macros. One of the macros hides certain command bars and disables the worksheet menu bar. On close the opposite is true. The problem is, if a user uses the disable macros when opening then the worksheet menu bar and other command bars are still available. I would like to hide all of the data sheets and display another sheet that would normally be hidden displaying a message that the macros have to be enabled for the program to work correctly if disable macros is chosen. When the enable macros are used I would like the Error page to be hidden.
View 6 Replies
View Related
Jan 28, 2009
I have been working on some Macros. I am compiling a macro that runs other macros. I have two noticeable problems.
1 - My SaveAs macro runs fine by itself. But when called or ran by another macro, (which calls more than one macro) the SaveAs macro it stops.
2- Many of my macros, when ran by another macro (which runs more than one macro) cycles through twice.
My specific question is about no. 2 and the following are the individual macros and the macro that runs them.
View 2 Replies
View Related
Feb 9, 2012
I need creating a macro that i can use in a file that will open all workbooks in a specified folder. Each .xls file has a macro that is slightly different and i want to go to one book and run one macro that will make all macros run.
View 4 Replies
View Related
Jan 10, 2014
I am trying to implement the idea of creating an application with two workbooks: a hidden code workbook (CodeWb) that holds all of the forms and macros, and a separate visible data workbook (DataWb) that uses the macros in CodeWb. The DataWb houses a little bit of VBA code to open the CodeWb, which then supplies the programming power to handle click events, etc., performed by the user in the DataWb.
I have advanced to the point of being able to open CodeWb from DataWb and trigger execution of a macro named "DataFileOpen" in CodeWb. This macro initializes things in DataWb and creates buttons there on a particular sheet, using the line:
Application.Run "CodeWb.xlsm!DataFileOpen"
So far so good. This works fine. My problem is that nothing happens when I click on the buttons created in DataWb, with their event handling code residing in CodeWb. Obviously, I'm missing something that maintains a connection between the two workbooks.
How can I use the code in CodeWb to handle all events occurring in DataWb?
View 2 Replies
View Related
Nov 17, 2006
Is it possible to create 1 macro which will execute multiple macros on different sheets?
I have approx. 12 macros that I can run in order, and I would like to create 1 button on the first sheet of the workbook to execute all 12 macros, which are contained on various other sheets. Is this possible?
When I attempted to do this, the master macro ran an odd function on my first sheet.
View 9 Replies
View Related
Oct 5, 2007
I have 3 seperate macros (macro1, macro2, macro3) that have to be run in order. Is it possible to create a macro to run them in order and what would the code look like? I will have it assigned to a button on the worksheet.
View 9 Replies
View Related
Dec 9, 2006
I've forgotten how to prevent the macros from showing in the macro dialogue box.
I'm sure it's got to be something with the VBA editor, but I can't figure it out.
I've got some files where the macro list is hidden and I'd like to do the same again, but for the life of me....I'm stumped. I'm sure it's something very simple.
I've protected the Worksheet & Workbook.
I've done some searching...."macro hide", "hide dialogue" etc. but can't seem to find what I'm looking for.
It's been a while since I had to amend code, as everythings been running very smoothly.
View 5 Replies
View Related
Nov 24, 2009
I am using the following code to identify any blank rows in a sheet and delete them:
View 3 Replies
View Related
Dec 13, 2006
Is there a possibility that there is a macro in the workbook even when there is no worksheet? I do not want a personal macro, instead, when I open a workbook(with no worksheet), goto tools->macro->open, I should see the macro. This would be helpful so that I can passover the macro to all my team mates and they can open any worksheet from there and work on the macro.
View 2 Replies
View Related
Apr 6, 2013
I have a workbook with numerous macros in it and they are assigned to buttons in the different worksheets. I am trying to record a new macro and when I start recording and click on one of the other macros nothing happens. This wasn't a problem in excel 2003.
View 2 Replies
View Related
Apr 14, 2008
I have excel 2007 and I want to record a macro. I have enabled all macros via the Trust Center settings and have even saved the current workbook (created from scratch in 2007) to a macro-enabled version.
But when I click on the 'developer' toolbar, 'record macro' is grayed out.
View 9 Replies
View Related
Dec 23, 2009
I'm verrry new to editing VBA code and I've been trying to figure out how to send a column of data ("Min Data" AB3:AB21 from "Sheet1") to a worksheet ("F4" - Min) and sending another column of data ("Max Data" AC3:AC21 from "Sheet1") to a different worksheet ("F4" - Max) by using only the one button ("Record Data" from "Sheet1"
I've been trying to figure out ways to edit the VBA in "Module 1" to make this work
Can anyone help me out here? If what i'm asking for isn't clear enough, just let me know and i'll try to explain in more detail.
View 6 Replies
View Related
Jul 28, 2008
I have a user that keeps a maintenance log in an Excel worksheet and sends an updated copy once a week to a board member. Two weeks ago, the board member started complaining that he was prompted to enable/disable macros on opening and became worried when my user stated that no macros were used in the book. He is now concerned that we have sent him a virus.
I know the file is clean because I've scanned it, and when I look at the file in VB, there are no modules or classes present just the Sheets 1-3 and the ThisWorkbook file. None of these objects have any code in them. My user does have some macros in PERSONAL.XLS but they are not used in the workbook in question.
No one else gets the prompt for enabling/disabling macros. Even if I set my security to prompt for any macros, I get no message. I'm convinced that there must be some setting in his Excel that is causing this individual to get this message. Is there anything else other than a macro that would cause this?
View 9 Replies
View Related