PDA

View Full Version : Get Specific Cell Values from another Workbook using VBA



dave123
08-06-2011, 08:14 AM
Hey,

My goal is to have a spreadsheet in table form which each row gathered its data from a different workbook. ie.

Date Value1 Value2 Value3
a b c d
e f g h
i j k l

the values a,b,c,d are in one workbook while e,f,g,h in another etc. Also, the values are not beside eachother in the workbooks but in the same cells workbook to workbook.

the workbooks are automatically downloaded into the same folder from a database so it would be nice if the macro could identify a new workbook in the folder and add it to the next row of the table worksheet shown above say i,j,k,l.

if you have any ideas which could help me out that would be superb.

Cheers,

Dave

Kenneth Hobs
08-06-2011, 05:05 PM
Welcome to the forum!

What you have asked requires several steps which is why you have not received a response.

What sheet and cells will the data be in in each of the files? It looks like sheet1 in cells A2, B2, C2, and D2. What sheet and columns should the data be copied to? Does the format need to be copied or just the raw data?

For adding data based on new files in the folder, I would suggest an Open event with an optional macro to manually update. I would put the file's name that was updated into a sheet and a column in the master file.

So, the project boils down to:
1. Batch Process
2. Get Data from New File(s)
3. Trigger Events to Process Data