View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
NigelShaw NigelShaw is offline
external usenet poster
 
Posts: 12
Default Looping Through Variables

Hi,

i am trying to loop through a set of variables to find and empty one. if it
is empty, fill it with data from the current cell. if it has data, move on to
the next variable until an empty one is found.

i have my variables named

CL1
CL2
CL3

right through to 2000.

i have a procedure that will clear all of the variables

CL1 = Empty
CL2 = Empty
all the way to 2000

my current code is

If CL1 = Empty Then
CL1 = check
Exit Sub
End If
If CL1 = check Then
Exit Sub
End If

( check is a value that is collected from a procedure that runs down a
column and gets the cell data. the idea is, it runs down the column, gets the
data, checks if the values match. if they do, exit, if they dont, move to the
next available empty variable to store the value )

from here, the procedure finishes and then places the collected values onto
a spreadsheet. i suppose its a bit like filtering as i only need 1 instance
of the value shown whereas the list that is check may have several.

hope this is clear enough to understand.

i thought about

for i = 1 to 4000

etc but i cannot get anything to work!!



many thanks,

Nigel

i currently havent got one to loop these yet!