+ Reply to Thread
Results 1 to 15 of 15

Need to copy values from all files in folder from specific worksheet

  1. #1
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Need to copy values from all files in folder from specific worksheet

    Trying to create a macro that will copy data from a specific range (A3:H8) in a specific sheet(Assay Chart) from closed files in the same folder. The files are created off a template where just the data in certain cells change. The data needs to be pasted as values as I am planning on graphing the data on one graph once copied over to my new sheet. If more info is needed let me know. I would like to have the data stacked. I have tried to build one on my own but I am new to creating code and I have not had much success.
    Last edited by jh51745; 05-30-2013 at 01:07 PM.

  2. #2
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    I found this code that is close to what I need after a couple modifications. But I need it to add the values vertically and not horizontal with the file name preferably in column next to the data while keeping source formatting. Also, don't need to create new workbook and sheet, need to keep in current one. Any ideas?
    Please Login or Register  to view this content.
    Last edited by jh51745; 05-30-2013 at 02:26 PM.

  3. #3
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    Still need help to modify the code I have to go from columns to rows and to paste the values from the formula.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need to copy values from all files in folder from specific worksheet

    Try attached.
    I am making few assumptions.
    You want to copy the file name in column A and the rest of the data in column B.
    Your sheet index number is 3.
    You can use sheet name instead if you want to use sheet name.
    Please Login or Register  to view this content.
    You have a header in row 1 in the master sheet and all data are copied in to this sheet
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    Nothing was imported, just says please wait while files are being imported. Is this suppose to be a long process?

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need to copy values from all files in folder from specific worksheet

    Could you please step over the code using F8 and see what error you are getting? Do you have files on your folder? Does the code open any worksheet?

  7. #7
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    When I step through it opens all the files and looks like it copies but nothing is pasted into master.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need to copy values from all files in folder from specific worksheet

    Do you have a header in master sheet? If you do not have, please put one in row 1

  9. #9
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    That did it. Thanks. Any idea on how to switch the columns after I have a chart inserted? First row should be category or x-axis.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need to copy values from all files in folder from specific worksheet

    Any idea on how to switch the columns after I have a chart inserted? First row should be category or x-axis?
    Not sure I understand your request.
    If its is a chart issue, I do not know. If you want to transpose ,i.e. change rows to columns, it is possible.

  11. #11
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    It is a chart issue. For some reason it is not setting my header as my x-axis/category after I have my chart created.

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need to copy values from all files in folder from specific worksheet

    I suggest you should post it on "charting and pivot table section" of this forum and you will get a speed response.

  13. #13
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    ok Thanks I will mark this portion of the problem as solved.

  14. #14
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    Forgot I need to open all files in sub folders as well. I have looked for ideas but not much luck.
    Please Login or Register  to view this content.
    Last edited by jh51745; 06-03-2013 at 01:29 PM.

  15. #15
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Need to copy values from all files in folder from specific worksheet

    edited to include current code for file selection.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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