Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Array Looping
I have a macro written to open a .csv file, process, and close it, but I'm
having trouble figuring out how to loop through a list I define that will give each of the document names to open. I could read in a list from a .txt or even define the list manually in VB, but I'm not sure how to "tell" the loop to pick an item in the array, then define that number as a variable that I can enter in my command to open the document, then (after closing) run the next item in the array. The array contents resemble {769290163 6017502167 5621119573 ...} The document names resemble 769290163.csv |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Array Looping
For i = LBound(myArray) To UBound(myArray) filename = myarray(i) 'rest of code Next i -- HTH RP (remove nothere from the email address if mailing direct) "Nikky" wrote in message ... I have a macro written to open a .csv file, process, and close it, but I'm having trouble figuring out how to loop through a list I define that will give each of the document names to open. I could read in a list from a ..txt or even define the list manually in VB, but I'm not sure how to "tell" the loop to pick an item in the array, then define that number as a variable that I can enter in my command to open the document, then (after closing) run the next item in the array. The array contents resemble {769290163 6017502167 5621119573 ...} The document names resemble 769290163.csv |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Array Looping
Thanks, this was dead on.
"Bob Phillips" wrote: For i = LBound(myArray) To UBound(myArray) filename = myarray(i) 'rest of code Next i -- HTH RP (remove nothere from the email address if mailing direct) "Nikky" wrote in message ... I have a macro written to open a .csv file, process, and close it, but I'm having trouble figuring out how to loop through a list I define that will give each of the document names to open. I could read in a list from a ..txt or even define the list manually in VB, but I'm not sure how to "tell" the loop to pick an item in the array, then define that number as a variable that I can enter in my command to open the document, then (after closing) run the next item in the array. The array contents resemble {769290163 6017502167 5621119573 ...} The document names resemble 769290163.csv |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to write an array to a range without looping | Excel Worksheet Functions | |||
Simple Array | Excel Discussion (Misc queries) | |||
Array / Looping Question | Excel Programming | |||
Error after last object in the array when looping For...each | Excel Programming | |||
Looping through Sheets and passing values to an Array | Excel Programming |