View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Danilo[_2_] Danilo[_2_] is offline
external usenet poster
 
Posts: 3
Default range and variant

From 5 different fies i have to fill a sheets("Base") where i have
Cod, Descripton, Amount

I do this
For iFile = 1 to 5
workbook.open "Agent" & trim(str(iFile))
set rng = Range("a10:u500") 'the range i need
arrAgents = rng.value

Call FillSheetBase

next


Now i need to fill form the variant array the sheets base
And i use this code in the sub FillSheetBase


for i = 1 to uBound(arrAgents,1)
Set c = Columns("A").cells.find(arrAgents(i,1))
if not c is nothing then
c.activate
c.offset(0,1) = arrAgents(i,5)
c.offset(0,2) = arrAgents(i,11)
endif
next

Any better idea?