Running macros in a macro in excel -
i'm trying write macro runs 2 other macros. however, second macro requires select location of file data is. there way of running second macro 10 times 10 different file locations. in summary, have 10 loops both macros.
some along lines of following sudo code:
file_loc = ('c:/users/desktop/....sim1.csv','c:/users/desktop/....sim2.csv'..'sim3'...sim10') in range (10): run macro1 wait calculation run macro2 file = file_loc(i) wait calculation copy cell a10 (result) az(i) next
is possibility in vba?
assuming macros this:
private sub macro1() ' prompt location ' stuff end sub
you refactor to:
private sub macro1(optional location string = "") ' test whether location specified, , prompt if not ' stuff end sub
that way, can loop through list of locations , pass each 1 parameter, while still leaving macro usable without information.
Comments
Post a Comment