+ Reply to Thread
Results 1 to 13 of 13

Retrieving data from multiple worsheets to single worksheet

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Exclamation Retrieving data from multiple worsheets to single worksheet

    I am completely new to Excel macros.If anybody could help me on this..that would be great.Thank you.

    I have two different folders

    Folder 1:With BOD( worksheets from client which can be in any number)-Format1
    Folder 2:Invoice(Single Worksheet where i should group all the details from BOD worksheets)-Format2

    Please find the Worksheet formats attached.

    Things to do:
    1.B3 (Format1) to A12(Format2)
    2.J&Q13(Format1) to X12(Format2)
    3.A,B,C,D,E,F,G,H,I,J,O,P,S,T,U27(Format1) to B,C,D,E,F,G,H,I,J,K,P,Q,T,U,V12(Format2)

    This should happen for each and every row in Format1 and and each format1 in folder 1.

    Any ideas would be much appreciated. thank you.
    Attached Files Attached Files
    Last edited by Ajitha; 04-10-2012 at 06:18 AM.

  2. #2
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Retrieving data from multiple worsheets to single worksheet

    Anyone there to help me on this!

  3. #3
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Retrieving data from multiple worsheets to single worksheet

    Welcome to the forum! First, let me ask you a few of questions for clarification.
    1. Is the Print Order sheet of the OrderFileMA-4743 what you are calling BOD? What is the Invoice sheet in that workbook?
    2. What is J&Q13? Does that mean that you want to concatenate J13 and Q13? Note that column Q is hidden in the Print Order sheet.
    3. When you refer to row 12 in Format 2, do you mean the next row on that sheet that doesn't have anything on it?
    4. It appears that you would like to process a collection of workbook that are all stored in a single folder. If that is right, are the files all named in a certain way that they will all show up on a search of the folder with no other files appearing in the list?
    How much time do you hae to do this? I am asking because since you are new to Excel macros, this could be a good learing experience for you if we take it slowly.
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  4. #4
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Retrieving data from multiple worsheets to single worksheet

    Hi,

    Thanks for your reply.

    Here are the answers for your questns.

    1.Yes,Print Order Sheet is BOD.Just ignore about the invoice sheet there in OrderFileMA-4743
    2.Sorry,it is Concatenation of J and O 13 as you can see in the PrintOrder Sheet.
    3.Row 27(Monthly Template) is the starting row of data ,last row of which is not same always.We are getting these details from customer, it can be in any number. I just want to copy it to Print Order Sheet starting from row 12
    Say
    Row 27(Monthly Template)-> Row 12(Print Order)
    Row 28-> Row 13
    nd go on till the last row in Monthly Template
    4.The workbooks are stored in Subfolders of main folder BOD and they are named in Date Format(10/04/2012)

    Please let me know if am not clear.
    I have to finish this work within this week.I would like to learn as much i can.
    Thank you.

  5. #5
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Retrieving data from multiple worsheets to single worksheet

    Let's see how well this works for you. I don't have a lot of test data and you may want it to do something a little different so we'll have to fight through this a bit. I've attached the Monthly Template file with some VBA in it. If you run the macro MergeOrders, it will display a dialog that will have a way for you to browse to the path containing the order files. You then press Run to merge all of the order files to the monthly template. It requires that the order files have a sheet name "Print Order".
    Monthly Template.xls

  6. #6
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Retrieving data from multiple worsheets to single worksheet

    It works like a charm!! thats great.I have gone through the code. Thanks for those comments besides every code.
    i have few concerns with the folder structure..will check that and will come back to you.

    Thanx a ton..

  7. #7
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Retrieving data from multiple worsheets to single worksheet

    Great! The file filter that is in the code is pretty simple - only looking for .xls. You may need to change that as you see fit based on the contents of the folder and the file naming conventions. Note that there is a sheet name restriction as well.

  8. #8
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Retrieving data from multiple worsheets to single worksheet

    Hi Bob,
    I have modified the code to get the worksheets from sub folders.It is working fine in Excel 2010 but actual user using Excel XP Professional.This macro is not working in it. I changed the Macro Security settings.It is calling the small form to browse the folder.but,after that nothing is happening
    Attaching the worksheet with my changes.
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Retrieving data from multiple worsheets to single worksheet

    I assume when you say nothing is happening, that your user is pressing the Run button and nothing is happening. The sheet names in the workbooks have to have the name "Print Order" before anything will happen. It ignores workbooks that do not have sheets with that name.

  10. #10
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Retrieving data from multiple worsheets to single worksheet

    All the excel worksheets are named as 'Print Order'.no change in that. I copied the same folder for a month and tried in my machine(excel 2010).It was working fine.thrown a message 'do you want to save this worksheet. Microsoft excel recalculates formulas when opening files last saved by an earliest version.'I just clicked 'Dont save' and it copied all the data.But In excel 2002 after clicking run,nothing is happening.

  11. #11
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Retrieving data from multiple worsheets to single worksheet

    I don't have Excel 2002 so I can't check this out. It is possible that file handling for reopening files is different between the two versions. Stopping Excel and restarting it, then run the macro. That will make usre that all files are closed when you start. Note that the macro ignores errors while opening the workbooks in read only mode.

  12. #12
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Retrieving data from multiple worsheets to single worksheet

    Hi
    It is working fine now.
    Saved the excel workbook in compatible mode and changed the calculation settings to manual.

    Thanks for your help.
    Some improvisation advised.Working on it.

  13. #13
    Registered User
    Join Date
    04-04-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Retrieving data from multiple worsheets to single worksheet

    Is there a way to copy data from Invoice worksheet to Printing schedule without opening Invoice worksheet explicitly?

+ 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