+ Reply to Thread
Results 1 to 12 of 12

Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007
    Posts
    12

    Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Hello all ,
    I have about 50 excel workbooks and each of these work books has about 20-25 spreadsheets. I am creating a database and i need to transfer all those data in access. I made a sample workbook for you guys. Plus i have the macro code in it as well. When i run the macro, for the 1st spreadsheets it runs fine. When it goes to the next spreadsheets, its over lapping previous date field with the current date field. I need some help with that.

    Here is the workbook and it has the macro code in it too. If you run the macro you will easily see what i am talking about.

    Thanks in advance!

    sample.zip

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Rahyan,
    The code does not do much, excep to select and copy in to active sheet. You are copying from format sheeet to active sheet.
    I do not know what you are trying to do. Part of the lines on function seems to be copied from Ron's code. Where are these 25 spredsheets? Are you trying to consolidate these sheets in to one on the same with workook?

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    I just checked it again and its actually copying the data from 1.3 - 1.9 and pasting it into format sheet. I am not sure who this Ron person is to be honest. and the sample file i uploaded its a dummy file. not the actual file i am working with. its all happening in one workbook. I am not pasting the file into diff workbook.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Okay,
    You just want to merge all the data from each sheet in to the format. I can see row 4 to 25 be copied in to format
    How do the dates in each sheet A1 will be copied in to format? I will write you a code if you could answer this question.

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    For an example, If you are copying the data from 1.3 sheet, on date row next to each data fields it should show 1/3/2012 since the date in 1.3 is 1/3/2012. and it will follow the same when it moves to next sheet (1.5)

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Date: 1/3/2012
    this date appears on a single cell, but the data to be copied occupies from rows 5 to 25. Where exactly on the format sheet this date will be copied. Is it on row 5, 6, or 25, or in all rows from 5-25 and in which column as well?

  7. #7
    Registered User
    Join Date
    12-12-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Let me send you an excel file and show you exactly how it should look! 1 sec!

  8. #8
    Registered User
    Join Date
    12-12-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    There you go!
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Okay,
    Few things not sure, for e.g I am not sure if you want to copy item and where the heading on the format should be(row)?
    but see the attached and can easily tweak it.
    Sorry! I am unable to attach a book (problem with the site).
    Plase try this code on the first attached book, not the latest you sent and let me know

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-12-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Thank you so Much! it worked just like how i wanted! just had one question. Are those dates coming from whats on each spreadsheets?

  11. #11
    Registered User
    Join Date
    12-12-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Thank you so Much!
    Last edited by JRayhan; 02-14-2013 at 03:12 PM.

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook

    Rayhan,
    Yes, column A is the date in A1 from each sheet.

+ 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