+ Reply to Thread
Results 1 to 7 of 7

Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the values

  1. #1
    Registered User
    Join Date
    09-21-2018
    Location
    Costa Rica
    MS-Off Ver
    365
    Posts
    30

    Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the values

    Hi there,

    I need to be able to collect the same sheet from multiple workbooks, in sheet1 in a main workbook, but I need to collect just the values, so it won't paste the formulas, I have been working on it for several hours, but I'm not finding a full code that could help me out with that.

    Thanks,

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the val

    Assuming that the multiple workbooks are in the sam folder you could perhaps use a macro like this.

    Please Login or Register  to view this content.
    You will need to change the string "E:\a_tester\" to the drive and the folder where your files are. This macro will find all ".xlsx" files. If you do have a mix of ".xlsx" and ".xlsm" files you could use a wildcard for the sFile string i.e. ".xls?"

    Alf

  3. #3
    Registered User
    Join Date
    09-21-2018
    Location
    Costa Rica
    MS-Off Ver
    365
    Posts
    30

    Re: Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the val

    Thank you so much, it works, the only thing is that it paste the data in A2 instead of A1 but thanks

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the val

    Thank you so much, it works, the only thing is that it paste the data in A2 instead of A1 but thanks
    That is the effect of the offset command to ensure that no data set is overlapping the previous one. To fix that the easiest way is just to add a line after the "loop line" i.e

    Please Login or Register  to view this content.
    Thanks for feedback and rep

    Alf

  5. #5
    Registered User
    Join Date
    09-21-2018
    Location
    Costa Rica
    MS-Off Ver
    365
    Posts
    30

    Re: Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the val

    Thank you, jajaja Is there a way to give you extra reputation? jajajaja, hey now there is something that pops up it says "This workbook contains links to one or more external sources that could be unsafe", it ask me to update or don't I have to click in every file, is there a way to do it with the same vba code?

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the val

    Is there a way to give you extra reputation
    Not as far as I know but I do think the rep you gave me are more than enough for any additional question in this thread.

    This workbook contains links to one or more external sources that could be unsafe", it ask me to update or don't I have to click in every file
    Not absolutely sure but you could try the command "Application.DisplayAlerts = False" i.e.

    Please Login or Register  to view this content.
    and I will try to see if I can find a file with external link I could test to see if this works

    Alf
    Last edited by Alf; 01-31-2019 at 01:51 PM.

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: Collect 1 sheet data from multiple Excel files in C:Folder and them paste just the val

    What I suggested above don't seems to work, instead replace line

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.
    and see if this works for you. And as I said before you must change the string "E:\a_tester\" with the drive and the folder where your files are stored.

    Alf

+ 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. [SOLVED] Extract data from multiple files in a folder (from a protected sheet)
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-30-2018, 02:34 AM
  2. Replies: 8
    Last Post: 10-11-2017, 02:45 PM
  3. Replies: 4
    Last Post: 05-02-2013, 11:16 AM
  4. Replies: 1
    Last Post: 03-28-2013, 02:49 PM
  5. Replies: 1
    Last Post: 09-22-2010, 11:00 AM
  6. Macro - Collect data - Select folder and loop through all xls files
    By zmalach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2008, 10:37 AM
  7. Macro - Collect data - Select folder and loop through all xls files
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-04-2008, 05:58 AM

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