+ Reply to Thread
Results 1 to 33 of 33

Excel Sheets data copy and paste into one sheet

  1. #1
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Excel Sheets data copy and paste into one sheet

    Hi,
    I am receiving excel report from multiple person with same format. Now I want merge or copy that excel workbooks to a single sheet in daily basis without affect exist data in that main excel.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Yep, it can be done......However, you need to give us something to work with....Upload a sample file depicting a before & after.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    Hi

    Kindly find the attached sheets like “mainsheet”, “report sheet1” and “report sheet2”

    Report sheet1&2 should come to the mainsheet
    Mainsheet.xlsxreport sheet 1.xlsxreport sheet 2.xlsx

  4. #4
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    hi sintek,

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Right, here you go...this will get you started:
    Open a folder on your desktop called REPORTS.....Put all your reports received into this folder.
    Paste this code into your MainSheet.Workbook as per sample attached.
    The code opens the folder and one by one copies the information from the report sheets to your mainSheet.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    PS....I noticed that you would like to increment the inputs in Column A
    Substitute with this code:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 05-10-2017 at 12:47 AM.

  7. #7
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    as per you code,i have executed code but its not come to main sheet. if possible to make it as on click button process?

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    See amended file upload and code in post 6

  9. #9
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    i not able to click the button see the screenshot Screenshot (1).png

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Did you do the following:
    Open a folder on your desktop called REPORTS.....Put all your reports received into this folder.
    Change this line of code to your Path
    Please Login or Register  to view this content.
    Change this line of code to your worksheet name
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    yes i change the path also but its getting error see this screenshot Screenshot (2).png

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    You did not change this line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    sorry from that and i have updated it. code is successfully but data is not copied.

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Works perfectly from my side....
    Explian to me what you have done so we can work through this:

  15. #15
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    Fist I create the folder in desktop name of REPORTS
    Then I keep the file in that folder Main Sheet excel and report excel file also
    Then I open the mainsheet after placed the code. It not coped in reports sheets

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Use the following Sample files I uploaded to see if it works..Keep the names the same. Other than that there is nothing more I can do....
    Put the 2 sample files in your Report Folder
    Put MainSheet on your desktop....Remember to change your path
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    how to run

  18. #18
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    i not able to click the execute button

  19. #19
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Like I said...It works perfectly from my side........Only thing i can think of is that your path is incorrect

    Did you change your path

    use the following sample files i uploaded to see if it works..keep the names the same. Other than that there is nothing more i can do....
    Put the 2 sample files in your report folder
    put mainsheet on your desktop....remember to change your path

  20. #20
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    Yes i change my path Dim rngNames As Range, rng As Range
    Dim lRow As Long, nextrow As Long, r As Long, lRow2 As Long
    Application.ScreenUpdating = False
    CopyFromPath = "C:\Users\travelmall\Desktop\REPORTS"
    Set CopyToWb = Workbooks("Mainsheet.xlsm")
    FileName = Dir(CopyFromPath & "*.xlsx")

    Do While Len(FileName) > 0
    Set wb = Workbooks.Open(CopyFromPath & FileName)

  21. #21
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Are you sure this is correct:
    Please Login or Register  to view this content.
    Open the folder called [Reports]
    Right click on any of the report files and click properties....See the location

  22. #22
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    yes its correct Screenshot (3).png
    PHP Code: 
    [ATTACH]517337[/ATTACH

  23. #23
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Then I am at a loss....
    This is the result i get after running the code from MainSheet
    Attached Files Attached Files

  24. #24
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    I have 2 questions that Which version is you are using? & Are you able to click that Execute button?

    Note : I am using MSOFFICE 2010 version & I am not able click Execute button.

  25. #25
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    2007, yes am able to click the button.....However, when my path is incorrect....Nothing happens

  26. #26
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Just found your problem !!!!!!

    Please Login or Register  to view this content.

  27. #27
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    put the \ or not

  28. #28
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    Yes must be there

  29. #29
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    thanks for your greatest help and if possible to do the daily basis without duplicate

  30. #30
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    is it possible to protect the main sheet or how to make read-only format????

  31. #31
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    After the code runs....... delete the files in Reports Folder......This way there will never be duplicates.

    Put this code after
    Please Login or Register  to view this content.
    before
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by sintek; 05-10-2017 at 05:20 AM.

  32. #32
    Forum Contributor
    Join Date
    02-04-2017
    Location
    chennai
    MS-Off Ver
    MS OFFICE 365
    Posts
    253

    Re: Excel Sheets data copy and paste into one sheet

    there is one doubt

  33. #33
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Excel Sheets data copy and paste into one sheet

    First of all....After everything does the code work perfectly?
    If so please mark thread as solved and add to reputation....

    is it possible to protect the main sheet or how to make read-only format????
    Ideally it is ime to open a new thread with a new request.

+ 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. Copy and Paste data automatically from master sheet to other sheets
    By wschleis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2014, 04:29 PM
  2. [SOLVED] insert sheets 2 & 3 and copy & paste data from the first sheet
    By RobinPrice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2014, 12:24 AM
  3. [SOLVED] VBA Code to copy data from one sheet and paste to multiple other sheets
    By JimmyG. in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2013, 04:25 AM
  4. Need macro to copy data from one sheet and paste to many sheets
    By Gillesrd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 10:39 PM
  5. Macro to copy and paste 70+ sheets of data onto 1 sheet
    By Helenew698 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-30-2012, 01:49 PM
  6. Copy data in multiple sheets and paste into one sheet.
    By Slomaro2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2008, 05:27 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