+ Reply to Thread
Results 1 to 12 of 12

Consolidating data from multiple worksheets

  1. #1
    Registered User
    Join Date
    06-03-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    57

    Consolidating data from multiple worksheets

    Hello All,

    I need some help.

    I have a workbook which has data in multiple tabs and also I have a macro which consolidates data from these tabs to one tab.(Master Tab name)

    Everytime whenver I have to execute this macro first I have to delete the master tab and then execute the macro.

    Is there a possibility where without deleting the tab can the data be consolidated.

    Example: if I run the macro the data is consolidated, then I add data in tabs and run then re run the macro It should leave a row and then add the new data to master tab.

    Also a last request can pivot be build on the master tab and auto refreshed when the macro is executed

    I have attached the spreadsheet

    Thanks in advance for all your support

    Kamal
    Attached Files Attached Files
    Last edited by kt090678; 02-14-2012 at 01:32 PM.

  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: Consolidating data from multiple worksheets

    Quote Originally Posted by kt090678 View Post
    Example: if I run the macro the data is consolidated, then I add data in tabs and run then re run the macro It should leave a row and then add the new data to master tab.
    Wouldnt this result in duplicate data in your tab?
    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
    Registered User
    Join Date
    06-03-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Consolidating data from multiple worksheets

    Yes you are correct, so in this case the data in master has to be cleared first then consolidate using macro and then auto refresh the pivot

  4. #4
    Registered User
    Join Date
    06-03-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Consolidating data from multiple worksheets

    Can someone help me out with my request

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

    Re: Consolidating data from multiple worksheets

    Just use this small code -
    Please Login or Register  to view this content.
    I have put this code in a blank module (Right click on Microsoft Excel Objects and select Insert->Module. Copy the code over).

  6. #6
    Registered User
    Join Date
    06-03-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Consolidating data from multiple worksheets

    Hello Arlette,

    Thank you for providing the code however I am getting the below error

    Code execution has been Interrupted while executing the macro

    I have attched the screenshot
    Attached Files Attached Files

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

    Re: Consolidating data from multiple worksheets

    You might have pressed the "ESC" key while running the macro. Click on END on this popup that you get and start running it again.

  8. #8
    Registered User
    Join Date
    06-03-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Consolidating data from multiple worksheets

    I have pressed the end button when this error popup however no data is getting copied, when I am click the continue button it is copying data from first sheet and again the error popups.I have do this till the data from all the tabs is copied and moreover In master tab I have standard headers in cell A2 to L column when I am executing this macro the data from these cells is cleared.

    Can you please provide me a permanent solution for this

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

    Re: Consolidating data from multiple worksheets

    Ok, i understand what you are talking about. I used to face this error earlier as well. This problem is due to a memory shortage in your system. Hence, it asks you to keep clicking the "Continue" button.

    Try doing this. Close your workbook without saving the changes, then close all other excel files (if open). Open excel again from start, then copy the code over to your file and run it again. You should not face this problem.

  10. #10
    Registered User
    Join Date
    06-03-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Consolidating data from multiple worksheets

    Hello Arlette,

    Thank you for providing the code and it is working fine.

    I have created a tab called Pivot based on Master data however we I am executing the macro for the second time macro is capturing data from pivot tab also becasue we have not provided any validation in our macro instead we all capturing data from all tabs to Master tab.

    Is there a possibility that we will put restriction to Pivot tab in macro saying that data from Pivot tab should not be copied to Master tab and vice versa once the Macro is excuted the data in pivot table should be auto refresh based on Master tab.

    Thanks for all your help once again

    Kamal

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

    Re: Consolidating data from multiple worksheets

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

  12. #12
    Registered User
    Join Date
    06-03-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Consolidating data from multiple worksheets

    Thank you very much for all your help.It is highly appreciated.

+ 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