PDA

View Full Version : Open each file in ary and transpose range



theta
06-27-2012, 09:23 AM
Hi all..I have been overcomplicating this problem.

I have an array of files (aryFiles) and an array of tab name (aryNames). They are linked 1:1 with an integrity check e.g.

aryFiles(1) = C:\Documents\TestFile0123.xls
aryNames(1) = TestFile-123.xls

I now need a code to go through each file in aryFiles and create a tab in the activeworkbook (wb1) or replace if it already exists, then go through the range(cells(startRow,i),cells(finishrow,i) where i = 1 to LastColumn.

For each iteration I need to copy this range, and paste it on the relevant tab in wb1.

Basically I am building a catalogue of all files in a directory, with a tab being created for each file, with each header range then being listed on a row by row basis within the new tab.

:)