View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Marcotte A Marcotte A is offline
external usenet poster
 
Posts: 66
Default do until...loop question

Is the first row of data (that you are checking against) created by the code or does it pre-exist? Either way, once that first row is defined, you should be able to map it to an array, then in your Do loop, test the current row against that array. I'm not too familiar with the nitty gritty of how arrays work, but something like this might work.

dim vTestArray() as variant
dim vCurrentArray() as variant
do
'your code
loop until vCurrentArray = vTestArray

you just have to be careful about when you create the first row of data and assign it to vTestArray. If you do it inside the loop, it may exit after only on iteration.


"B" wrote:

I am trying to run a code (where rows of data are produced) in a loop until a certain condition is met: the current (last generated) row is equivalent to the very first/top row of data.
There's a certain number of cells/columns in each row, but the number of rows to be generated is dependent upon the above condition.

This is for a grad school project and I have yet to find a resource to help w/ this.
Any examples or ideas anyone can provide would be extremely helpful.