View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Looney David Looney is offline
external usenet poster
 
Posts: 1
Default Setting up an incremented Variable name

I'm looping through a named range looking for cells whose value matches a
criteria. For each of those cells that match, I want to assign the cells
value to an "incremented" variable (Var1, Var2, Var3, etc.)



Counter = 1

Set rng = range("myRange")



1 For each cell in rng

2 If cell.value = "whatever"

3 Var & counter = cell.value

4 End if

5 Next cell





I cant get line 3 to work (Var1, Var2, Var3)



Thanks