+ Reply to Thread
Results 1 to 9 of 9

copy data from multiple files to a single

  1. #1
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68

    copy data from multiple files to a single

    Hi All,

    I request you to please help me with this problem. I have also posted my problem on mr.excelforum.

    The problem is like this

    I test samples and data from these are analyzed using excel. I copy the relevant specimen data and results to worksheet 5 of every workbook for sake of simplicity.The data occupies cells A1 to A10 of Sheet5 for every specimen's workbook.

    I store all workbooks in a folder. From these workbooks a Database is made.
    The format of Database sheet requires that data from individual specimens are first placed in column D and then E, F, G... and so on.

    I need to extract and copy data from all the workbooks in this folder to this Database workbook.

    I understand it becomes easier if all workbooks are in the same folder and therefore I have done so in my case. Also, cells A1 to A10 of Sheet5 in each specimen workbook contains data which makes it simpler to select while copying.

    Please help me with this VBA code !
    I thank you all ,
    Regards
    arora

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If you search the Forum, I have posted code to copy data from workbooks stored in a folder.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68

    Smile

    Hello RoyUK

    Thank you for your reply, Infact I used your and Dominic suggestion of making macro as an Add-In and then putting a menu to trigger it

    I did tried your code and tried modifying it also. I was trying to use .Copy Destination function but I was unsuccessful.

    The problem is also that first specimen data is to be copied to Column D (i.e cells D1 to D10) and then on in subsequent columns (E1 to E10, F1 to F10 and so on..)

    I have also attached Database workbook that shows where data is being pasted. Here, data is copied first to column D and then further.

    Can you please help in in modification of this code ...

    Thank you again,
    arora
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If the attached workbook is the database then you will have problems. An excel database needs to be in a table format - one row for each data set.

  5. #5
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68
    Hello RoyUK,

    Does it means that I will not be able to copy a column of data ?

    or may I can first copy data as a row and then transpose it to form a column !

    I was thinking of copying as per the following scheme

    for first sample's workbook :: cell A1 (in sheet5 of workbook) to D1 (in database), A2 to D2 ..... and A10 to D10
    for second sample's workbook :: cell A1 (in sheet5 of workbook) to E1 (in database), A2 to E2 ..... and A10 to E10

    and the count of number of files will then itself determine how many columns are to be filled. Is it not possible ?

    Please consider..
    regards
    arora

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by arora View Post
    Hello RoyUK,

    Does it means that I will not be able to copy a column of data ?

    or may I can first copy data as a row and then transpose it to form a column !

    I was thinking of copying as per the following scheme

    for first sample's workbook :: cell A1 (in sheet5 of workbook) to D1 (in database), A2 to D2 ..... and A10 to D10
    for second sample's workbook :: cell A1 (in sheet5 of workbook) to E1 (in database), A2 to E2 ..... and A10 to E10

    and the count of number of files will then itself determine how many columns are to be filled. Is it not possible ?

    Please consider..
    regards
    arora
    I can't follow what you mean, attach a sample data sheet.

  7. #7
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68
    Hello RoyUK,

    Thank you again for your reply,

    I have attached 3 files for your reference, these are CT02, CT03 and database.

    CT02 and CT03 are the usual specimen files containing data and from them data is copied to databse.xls

    The sequence is

    Step 1. from Sheet5 (cells A1 to A22) of file CT02.xls, column D (cells D8 to D29) in database is filled

    Step 2. then from Sheet5 (cells A1 to A22) of file CT03.xls, column E (cells E8 to E29) in database is filled

    Step 3. This way for every CT file in the folder a column in databse.xls is filled.

    Thank you again for your help,
    regards
    arora
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68
    Hello RoyUK,

    Please Help !!! In case my not clear even now, I will again write in detail or try and simplify things ..

    Please Help !!

    regards
    arora

  9. #9
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    macro

    Hi
    save the databasenew file in the same folde as CT series and run the macro. it will pull data from col A of each file
    Ravi
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Combining data from 2 worksheets into a single data source
    By skerdoba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2008, 06:38 PM
  2. Copy data into multiple cells
    By Sirishgreen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-29-2007, 06:40 PM
  3. New to writing macros
    By ynnod in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-06-2007, 10:20 PM
  4. Automated search and copy lots of data
    By Xelpme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2007, 08:51 AM
  5. Trying to pull Data from 52 xls files.
    By Krushert in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2006, 08:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1