+ Reply to Thread
Results 1 to 55 of 55

Combining multiple workbooks from different location in to one sheet.

  1. #1
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Exclamation Combining multiple workbooks from different location in to one sheet.

    Hi Guys...!!

    Hope you all are well..

    This forum site is more helpful site for me to fix up the issue's i have and had.. So Thanks to the Admin.

    Now let me tell about my issue .

    I just want to combine multiple workbooks in to one sheet which all are in different location and also i dont want to copy the whole workbook data..!!

    Each workbook have a Sheet named as Prefix, This sheet value's needs to be combined in one sheet.

    I have searched through out this forum and i haven't found any post related to my issue.

    Guys can please help me here ?

    I have to combine more than 20 files in different location ..!!

    Many thanks in advance for all your help and time.

    Thanx,
    Safi.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    When you say different locations, would all the files in those folders need to be consolidated? Also, are all the folders under the main root folder or in different drives?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Hi Arlu,

    Thansk for your reply..

    Yes you are right we need to consolidate all teh workbooks.

    All are in same drive but path's are different.

    And also the file name (Wokbook) Name will be varying for a time being..

    Thanks again,
    Safi.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    So for e.g. if we consider the file path to be D:\Reports\ then all the files from all the subfolders in this path should be consolidated, right?

  5. #5
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Nope, Not all teh files.

    We will provide teh excat path of the workbook and will need to consolidate them in to a single shhet.

    Since there some unwanted files should be thre in teh folders/Subfolders.

    Thansk,
    Safi.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    But you said there are multiple folders. So you will provide each folder from which the data should be consolidated?

  7. #7
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Yes, You are right.. !!

    Thanks,
    Safi.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Ok, whats the sheet name containing the file paths and in which column?

  9. #9
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Thansk Arlu,

    Here you go..

    Please note taht the given path folder must have only one workbook but the name of teh workbook will differ for each folders.
    ---------------------------------------------------

    Path no: 1

    T:\GBCWBRKCS001\NortelSW\GNP_NGNP THUS_YOURCOMMS\BT\GNP\ENERGIS\POI\ABERDEEN (IMPORT)\EXPORT\PDI\CURRENT\MASTER

    Pth no: 2

    T:\GBCWBRKCS001\NortelSW\GNP_NGNP THUS_YOURCOMMS\BT\GNP\ENERGIS\POI\BANGOR (IMPORT)\IMPORT\PDI\CURRENT\MASTER


    Path No: 3

    T:\GBCWBRKCS001\NortelSW\GNP_NGNP THUS_YOURCOMMS\BT\GNP\ENERGIS\POI\BOURNEMOUTH (IMPORT)\IMPORT\PDI\CURRENT\MASTER


    Path No: 4

    T:\GBCWBRKCS001\NortelSW\GNP_NGNP THUS_YOURCOMMS\BT\GNP\ENERGIS\POI\BRADFORD (BOTH)\IMPORT\PDI\CURRENT\MASTER


    Sheet Name : Number -- Prefix

    Coumn numbers : A to Z

    --------------------------------------

    The workbook may have mutiple sheets but we want to get onlty teh dat which SHEET named as "Number -- Prefix".

    I'm looking forward to hear from you..

    Thanks in advance.
    Safi.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    The sheet is named as "Number -- Prefix" or it has a number and a prefix?

    All columns from A to Z have the paths in them?

  11. #11
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112
    Sheet named as " number -- prefix".
    And I'm not sure what you mean by next question..
    I thought which columns we need to pull.
    Thanks,
    Safi.
    HTH!!
    Safi.

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    No, i asked you the sheet name where the paths will be given and also the column where the paths will be listed.

  13. #13
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112
    Sorry arlu..
    The paths are not in any sheets..
    If u wanting me to put the paths in sheet.
    I'll prepare it for you now..
    T
    TIA,
    Safi

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    If the paths are not listed, then what was your initial plan to work it out?

  15. #15
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Hope i have misswrote something..

    is there any possibilities to add the path's inside the codings ?

    Daily i have to check these folders and need to copy the data and pasting into a single sheet.

    Thanks,
    Safi

  16. #16
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Are the paths likely to change frequently or is it the same paths that you need to access each time you run the macro?

    You can do this -

    Have an excel sheet which contains the paths. The macro will be in this excel sheet and it will consolidate the data for you in the 2nd tab of the same file.

  17. #17
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    No path will be same..
    So can you please provide me the macro file ?

    many thanks,
    Safi.

  18. #18
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    No, what i meant to ask you is - If this week you run the macro and you have 10 different folders, next week when you run the macro again, will you use the same 10 folders or there will be some others?

  19. #19
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    No, The same 10 folders will use run. Folder willnot change.

    thanks,
    Safi.

  20. #20
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Hi Arlu,

    I have attached the worrkbook which contains path's..

    Can you please help me ?

    Thanks,
    Safi.
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    10-02-2012
    Location
    Delhi, India
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    66

    Re: Combining multiple workbooks from different location in to one sheet.

    Hi,

    I am also looking for some code to do same kind of work

  22. #22
    Registered User
    Join Date
    04-06-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Combining multiple workbooks from different location in to one sheet.

    Wouldnt you be able to connect the files together as source files, copy the data to different worksheets respectively, and set it to auto update, and create an 11th tab with the formulas you need to interperet the 10 tabs?

    Have workbook 1-10 as sources and assign them to copy the worksheet you need to a worksheet in your destinaation. The source files would need to be locked into there locations i do believe.
    Last edited by mconnelly2012; 04-13-2013 at 06:22 PM.

  23. #23
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Good Afternoon Arlu,

    Did you managed to have a look on my post ?

    Thanks,
    Safi.

  24. #24
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Did you review post 22 and see if the suggestion works for you?

  25. #25
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    HI arlu,

    Yes, But thing is that each and every time i have to open all the 10 sheets and have to copy the deails right ?

    It's same i'm doing in a single sheet.


    Thanks,
    Safi.

  26. #26
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Ok, let me check what solution i can work out.

  27. #27
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Yeah okay Thanks Arlu..!!

    I'm looking forward to hear from you for a better solution..!!

    Thanks,
    Safi.

  28. #28
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Hi Arlu,

    The attached file i ahve found in te internet seems taht thsi is doing the same what i need, But we need to do some amendments in the coding..

    can you please have a look at it ?

    I'm not sure whether i can post the Thread link here ?

    So just i'm attaching teh file.

    Please try to run it and help me to sort thsi up ?

    Thansk for all your help.

    Safi.
    Attached Files Attached Files

  29. #29
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Can you please unzip the file and load it here? I have an issue with winzip on my system.

  30. #30
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Arlu,

    Here is the master file with the Macro, Please look at it.

    Seems taht the coding is wrote for combining teh multiple workbooks.

    We have to choose the workbooks in a sinlgefolder, each and evry time we run the macro.



    Thanks,
    Safi.
    Attached Files Attached Files

  31. #31
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    So all the files in each folder path should be consolidated right?

    And all the files have just one sheet? All the columns from the sheet should be consolidated?

  32. #32
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Yes, All the files in each folder path should be consolidated..!

    The workbook may contain more than one sheet but all workbook must have a sheet named as " Number -- Prefix "

    And not all the cloumns required, From A toZ will be okay..

    Thanks,
    Safi.

  33. #33
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Experts,

    Can you please help me ??

    Thanks,
    Safi.

  34. #34
    Registered User
    Join Date
    04-17-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    1

    How to use macros to copy a row from worksheet1 and paste it column-wise in worksheet2?

    Please let me know the code for Macros.How to copy 1 row from workbook1 and paste it in another column in workbook2

  35. #35
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    MadhuMithaP,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.

  36. #36
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    You have mentioned the paths as - T:\GBCWBRKCS001\NortelSW\GNP_NGNP THUS_YOURCOMMS\BT\GNP\ENERGIS\POI\ABERDEEN (IMPORT)\EXPORT\PDI\CURRENT\MASTER

    So is Master the last folder and the files reside inside this folder?

  37. #37
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Hi Alru,

    Thansk for looking in to it..

    Yes, Master is the folder and it contain a Single workbook.

    Thanks,
    Safi.

  38. #38
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    The folders can have any number of files in it right?

  39. #39
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Try this code
    Please Login or Register  to view this content.

  40. #40
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Arlu,
    No, Most of all the Master folder should have only i file in it.

    I ahve tried taht, And recived an error msg taht "Run Time Error - 1004"

    Thanks,
    Safi..

  41. #41
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    On which row are you receiving the error?

  42. #42
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Arlu,

    No Lines were highlighted in teh coding

  43. #43
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    When you get the error and click on Debug, it will take you to the code window and highlight a row in yellow. Which is this row?

  44. #44
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    The pop up doesn't asking to debug..!!

    Have two option " OK " and " HELP "

    Thanks,
    Safi.

  45. #45
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    And if you click on OK, it just stops?

    Let me test it at my end.

  46. #46
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Yes, It's just stopped running

    Yes, Please

    Thanx,
    Safi.

  47. #47
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Try this code
    Please Login or Register  to view this content.

  48. #48
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Arlu,

    Can you please advise me taht where i want to put the Path ??

    Thanks,
    Safi.

  49. #49
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    You need to put the code in the file containing the paths. The macro will automatically pick up the paths from the 1st sheet and consolidate the data in the 2nd sheet.

  50. #50
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    I have pasted teh Path's in the same sheet in the Range of A.

    Still i'm getting the Same error

    Another error : 400 , No wordings


    Thanx,
    Safi
    Last edited by safi0102; 04-17-2013 at 07:51 AM.

  51. #51
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    You are pasting the paths in column A right?

    I ran it at my end and it worked fine. Check if the file paths are correct which you have listed. I had changed it to my system paths while doing the testing.

  52. #52
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    Yes, I have teh path's in Column A.

    But still im getting the eror no : 400..!!

    Thanx,
    Safi.

  53. #53
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112
    Arlu, found the bug ..!! The first file has saved in "xml" format..
    Now the code is working fine but it's just pulling only 2 rows from each workbook.

  54. #54
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining multiple workbooks from different location in to one sheet.

    Change this line from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  55. #55
    Forum Contributor
    Join Date
    01-25-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Combining multiple workbooks from different location in to one sheet.

    That's wonderfull..!!!

    The code work's fine

    Really it's much appreciated and What a star youare !!

    Cheers,
    Safi.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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