Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50167

Macro running other macros does not fully execute

$
0
0
Hello,

I am attempting to run a macro which executes a couple of different macros in each of a bunch of worksheets in one workbook. It repeats the below for Sheet1, Sheet2, etc.

Code:

    Sheets("Sheet1").Select
    Application.Run "'Master.xlsm'!Macro1"
    Application.Run "'Master.xlsm'!Macro2"
    Range("A1:G1").Select

Unfortunately, it only seems to run through the first three lines of that code and only for the fist iteration, i.e. on "Sheet1", and then it stops. No error or anything like that.

I've looked around a bunch, and I've tried line by line execution, removing the SHIFT key from my shortcut command, removing certain sections, and so on. If I remove the first iteration of the code, it will then run through the first three steps on "Sheet2" and then stop. If it's relevant, the sheets are not actually named "Sheet1", "Sheet2", etc., I just edited the code above.

Any ideas? Thanks for the help!

Viewing all articles
Browse latest Browse all 50167

Trending Articles