Need Help!!!!

AcTiVation

New Member
Joined
Mar 4, 2002
Messages
8
I'm in need of VBA code that will collect data from a range in different excel files that are located in different directories with different file names, and each with their own password. Then paste the data ranges from all the files in a central file which will then be used for statistical purposes.

Thanks in advanced.

L.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi.
You could try method where location of files are on excel sheet, on column A. Column B has file name, and column C passwd.

Important! file location in sheet must be in format \networkdrive_path, not in networkdrive letter.

sub open_all
a=1
while cells(a,1).value <>""
file_location=cells(a,1).value
file_name= cells(a,2).value
file_passwd=cells(a,2).value
workbooks.open file_location & file_name password=file_passwd
call copy_data
wend
end sub

function copy_data
I think you can personaly code this, this would be easy, activate workbook, then worksheet, select range, copy, close activewindow, paste to central function, into first blank row
end function

HTH
donalde
 
Upvote 0

Forum statistics

Threads
1,223,406
Messages
6,171,927
Members
452,434
Latest member
NUC_N_FUTS2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top