Hi,
need macro to copy data from multiple workbook to master sheets.
Hi,
need macro to copy data from multiple workbook to master sheets.
Happy to Help
VISHA
Click *, if the suggestion helps you!
If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>> "Mark your thread as Solved"
Hi Visha.
Post a sample file
Click *, if my suggestion helps you. Have a good day!!
A few questions -
Are these workbooks having the same headers? Are they stored in one folder? Is it just 1 sheet that needs to be copied or multiple sheets within the workbooks?
Does the master workbook already exist and data should be appended at the next available row of the master file or should the master workbook be created from scratch?
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]
hi,Arlu
All these workbooks having the same headers and they stored in one folder and master file is open.
Hi,jraj
please find sample file
Should the data from the attached files be added from the next available row onwards or should the master file be cleared and then fresh data input?
Arlu
yes data file should be added from the next available row one below one, according to all sheets .
Try this code -
Copy the Excel VBA code![]()
Please Login or Register to view this content.
Select the workbook in which you want to store the Excel VBA code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
Choose Insert | Module
Where the cursor is flashing, choose Edit | Paste
To run the Excel VBA code:
Choose View | Macros
Select a macro in the list, and click the Run button
Arlu Thanks for all you help
Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.
In future, to mark your thread as Solved, you can do the following -
Select Thread Tools-> Mark thread as Solved.
Incase your issue is not solved, you can undo it as follows -
Select Thread Tools-> Mark thread as Unsolved.
Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
hi,Arlu
your code has run but data has not been copy.
Did you copy the code to the Master file code window?
yes i have copied in master file window.
Did you change the file path in the code fromto the path where your files reside?![]()
Please Login or Register to view this content.
Also ensure that the master file is not in the same path where the files are stored.
Hi,Arlu
pls check after changing the path it not working
![]()
Please Login or Register to view this content.
Its is showing Consolidation complete and Master workbook is Blank??
Change this line fromto![]()
Please Login or Register to view this content.
P.S - Please do not bump the thread so many times.![]()
Please Login or Register to view this content.
Last edited by arlu1201; 01-29-2013 at 08:34 AM.
Arlu still master file showing blank (Consolidation complete)
Can you upload your master file after running the macro? I will use the earlier file you upload as the "before running macro" file.
I ran the macro at my end and it works.
Please find attached
If you have put the macro in the master file, you should save it as a .xlsm file not .xlsx.
Path = z:\visha.h\courier folder for -all file
path = z:\visha.h\idbi for -courier report master
Hope now u help me
thanks
You are not understanding what i am saying. You have to save the macro in the Courier Report Master file and save the file as a .xlsm file. Check under the file save as options.
This is not the solution to the problem but just one point that i need to bring to your notice.
I am checking the code along with the files right now.
All your data is getting consolidated into the "TAT" sheet of your file which is hidden.
Try this updated code -
![]()
Please Login or Register to view this content.
hi,Arlu
sorry to disturbing you again again
i have save file in .xslm but again showing (Consolidation complete) and file blank.
Did you read the comment in post 24 and try the updated code?
Sorry Arlu
I got it finally
Thanku so much once again.![]()
I have a very similar problem to solve as visha_1984. I tried to use his excel sheets and data as a practice before setting up my own files. However, I'm getting a "run time error 9, subscript out of range" and the code is not drawing the data into the master workbook. The debugger highlights the line "Set sourceData = sourceBook.Worksheets ("MASTER").
Is there anything I need to change in the code below to get this to work? I'm pretty new to VBA programming so if someone could include an explanation as to why I'm getting the error along with the solution that would be greatly appreciated. Thank you.
![]()
Please Login or Register to view this content.
Last edited by arlu1201; 02-08-2013 at 05:23 AM.
Ghoststark21,
Check if the name of the source sheet is named as "MASTER". If not, then change it in the code to whatever is the name of your source sheet.
I am using the above macros to copy datas from the different excel files. Unfortunately I am facing a Weird proble.
I am having three excel files in the folder and each sheet has min 50 entries. When i run the macros I am able to see the only 1 column from the first excel sheet and 2 column from the second excel sheet and 4 coloumn from third excel sheet.
Can you please help out with this.
Note: I have changed the path alone in the macros in which you have pasted.
Thanks
Vinoth
u767,
Your data might be differently formatted. Its better you create a thread of your own and attach a sample file. You can link back to this thread by providing a link of this thread in your thread. I will help you there.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks