Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write an array to a range without looping Andy Excel Worksheet Functions 3 April 27th 11 12:52 PM
Simple Array Marilyn Excel Discussion (Misc queries) 1 August 3rd 07 03:42 AM
Array / Looping Question Matt W[_2_] Excel Programming 7 April 10th 05 07:52 PM
Error after last object in the array when looping For...each Gunnar Johansson[_3_] Excel Programming 3 December 14th 04 12:23 PM
Looping through Sheets and passing values to an Array Michael Rhein Excel Programming 2 February 13th 04 10:54 AM


All times are GMT +1. The time now is 01:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"