range and variant

D

Danilo

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top