Amerifax-Bob Posted April 25, 2011 Report Share Posted April 25, 2011 I have a Macro that I am going to need to run against 100's of 1000's of records. How do I insert the syntax to run a loop in the Macro so that after it finishes running in continues until: A. It is end of the file OR B. It has processed a specified amount of records. I would like to be able to do it both ways. Bob Quote Link to comment Share on other sites More sharing options...
Cory Posted April 25, 2011 Report Share Posted April 25, 2011 In these cases I split the %list% into an array and then do a repeat with a counter %C%. Then my first three commands are “If %List[%C%]% ="" (double quote is indicating nothing or null) then break. But if you had a set %limit% I would set the number of times to repeat to %limit%. Obviously this is only when the array elements could exceed the limit. In some cases there are blanks in my list. In those cases I do an additional repeat in front but I count down instead of up to find the first non-blank field. Then I repeat that many times in the main loop. This is also nice for progress indicators. Yo ucould do a condition there to set it to whichever is the smaller value, the number of items in the list or the limit. Quote Link to comment Share on other sites More sharing options...
Amerifax-Bob Posted April 26, 2011 Author Report Share Posted April 26, 2011 I did figure out the Repeat Command. And it is working pretty well for us. I will definitely start reading about Arrays to start to have a better understanding of the different options I might have to run some of these things we are doing. Bob Quote Link to comment Share on other sites More sharing options...
Cory Posted April 26, 2011 Report Share Posted April 26, 2011 Arrays are the only reasonable way to handle large amounts of datalike you are dealing with. They may seems strange but just think of them ascolumns of data like in Excel. Each column a different array variable and eachrow a different element. Then you just plow thru them with repeats and countersfor the most part just like you go down a spreadsheet row by row. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.