View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Eric Winegarner[_2_] Eric Winegarner[_2_] is offline
external usenet poster
 
Posts: 1
Default Create an array inside a For...Next loop

I will be looping through a dynamic range of cells, and when my condition is
met I want to add that value to an array, and then empty the contents of the
array onto a different spreadsheet. As a simple example:

'Adding item to array
For each cel in Range("A1:A100")
If cell.value = "X" Then
add cell value to my array
end
Next cell

'Writing data to new spreadsheet
For each cell in Range("B1:B100")
add array item to current cell
Next cell

Does anyone have any suggestions? Thanks in a advance!