Ask Experts Questions for FREE Help !
Ask
    Wonder84lalala's Avatar
    Wonder84lalala Posts: 41, Reputation: 1
    Junior Member
     
    #1

    Dec 20, 2007, 10:18 AM
    Auto-Macro in Excel
    Hi,

    I have a lot of macros built-in Excel, but when I want to update the certain data , I have to run them individually each time. Do you know anyway I can auto-run these macros?

    Thanks for any help.
    Duane in Japan's Avatar
    Duane in Japan Posts: 282, Reputation: 8
    Full Member
     
    #2

    Jan 7, 2008, 06:23 AM
    I do not have a straight answer for you from within Excel, except to say that I believe you could write a VBA code to do this for you but I do not know VBA well enough to point you in the correct direction.

    If you get the pay version (cheap) of Aldos Macro Recorder, there is a section built in that if an entry is made, the macro will run, since it is separate from Excel, Aldos Macro will run your Excel Macro and there you have it.

    I also believe that you could build a Visual Studio 2005 or 2008 beta program to do exactly what you want but there is a learning curve, but there is tons of help available, and I have plenty of info for those sites too.

    I am thinking that if a cell is updated on your Excel sheet, then there could be a shortcut created in the cell (hyperlink) or the cell next to the updated info and you could easily access the hyperlink directly from the updated cell or its neighboring cell with ease, this is the easiest fix I think, yes it still manual but you will not have to drill down through the macro listing to find it, the exact macro of choice is right there in a hyperlink or shortcut.
    tbakry's Avatar
    tbakry Posts: 18, Reputation: 1
    New Member
     
    #3

    Mar 8, 2008, 04:17 PM
    You can do an autoexec but there are security implications. I think what you are looking for is Auto_open() It is a VBA module. I believe that it may require you to modify your security settings to work. If you go into the VB editor you can create a module called Auto_open(). Here is an example of one that I did to print off multiplication table worksheets for my kids:
    Create a VB module
    example:

    Sub Auto_Open()
    '
    ' Multiprint Macro
    ' Print Multiplication Practice Sheets
    '

    '
    Workbooks.Open Filename:= _
    "C:\Documents and Settings\Martha\My Documents\xls\Andy Multiplication.xls"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Workbooks.Open Filename:= _
    "C:\Documents and Settings\Martha\My Documents\xls\Joe Multiplication.xls"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    ActiveWorkbook.Close
    ActiveWorkbook.Close
    End Sub

    The macro is saved into a specific worksheet and when the worksheet is launched, it automatically executes. The worksheet does prompt me to allow macros.

    Cheers,
    Tom
    valleyboy08's Avatar
    valleyboy08 Posts: 1, Reputation: 1
    New Member
     
    #4

    Dec 4, 2008, 10:34 PM

    I guess you can use this for your purpose Activeworkbook.RunAutoMacros xlAutoOpen
    TheCodeCageTeam's Avatar
    TheCodeCageTeam Posts: 4, Reputation: 1
    New Member
     
    #5

    Jan 15, 2009, 05:46 PM
    Quote Originally Posted by Wonder84lalala View Post
    Hi,

    I have a lot of macros built-in Excel, but when I want to update the certain data , I have to run them individually each time. Do you know anyway I can auto-run these macros?

    Thanks for any help.
    You simply CALL the macro's one after the other like this (I've used code that should go in the ThisWorkbook module (Alt+F11))
    Code:
    Private Sub Workbook_Open()
    Call Macro1
    Call Macro2
    Call Macro3
    '....etc
    End Sub
    Replace Macro1... etc for you macro name.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Excel vlookup and auto start macro [ 1 Answers ]

I've set up a vlookuop. I want to retrieve a blank value. Lookupup code is the number 1 and the value for one is blank. At one point it worked fine and now it won't. I've set up a main menu in excelfor excel worksheets in a workbook. When I bookmark a worksheet I would like a macro to autostart...

Recording a macro in Excel [ 2 Answers ]

Need a macro that will select the cell one place to the left, edit the content, hit enter, and then move to cell below where started and repeat to end of column (last cell with a value). Example: 123-456789 is format of cell to be edited - need to remove the hyphen. Someone had created it...

How to Automate a macro in excel [ 4 Answers ]

A program logs files at random in txt. abc_log.txt (example) When new info. Is added to the txt file,manualy activate macro and it does what it suppose to do, all OK there. Is there a way a macro code or excel, or perhaps a BAT program can be made to simply "detect" when new data is added...


View more questions Search