+ Reply to Thread
Results 1 to 10 of 10

Copy range from one sheet to another

  1. #1
    Registered User
    Join Date
    03-31-2012
    Location
    Nottingham
    MS-Off Ver
    OFFICE 365
    Posts
    17

    Copy range from one sheet to another

    Morning,

    I have a workbook which contains the following sheets.

    Cycoms_Source
    Cyc_Summary

    Source contains a list of names in column A, there is no set number of names it can range from 1 to 000's. For each name in this list there is a worksheet with a corresponding name. All these worksheets are identical. It's just the data that is different.

    The data on these named worksheets is contained in row 8 through 22, columns A - H. Not all rows will have data, some worksheets may have 1 or 2 rows of data others may have 10 rows.

    I would like a macro that copies the relevant data contained on these worksheets and pastes it to the Cyc_Summary sheet. It would somehow have to know which worksheets to take information from, based on the Source list then workout which rows contain data from each worksheet before adding it to the summary sheet.

    I don't have any idea where to start on this one.

    Thanks

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy range from one sheet to another

    can you attach a sample file with data and desired result and notes ?
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy range from one sheet to another

    Hi, patel45,

    maybe try again and read the opening post - everything you ask for is written down in the text so maybe you should work from that with your solution.


    @colins5286:

    What I canīt understand is
    For each name in this list there is a worksheet with a corresponding name
    In the very same workbook?

    The Range starts with row 2 on the Source sheet, you would need to adpat that to your needs:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    03-31-2012
    Location
    Nottingham
    MS-Off Ver
    OFFICE 365
    Posts
    17

    Re: Copy range from one sheet to another

    Hi,

    Thanks for your quick response. I have tried this code, but it doesn't seem to copy any data from the worksheets.
    In column A (starting with A5) there is a list of numbers (e.g. 15879, 54786, 33178), there are then individual worksheets within the workbook called 15879, 54786, 33178. These worksheets are all identical in layout, just with different data.
    I use this list as a table of contents essentially, each name in the list is a hyperlink to the actual worksheet.

    The amended code I used was:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-31-2012
    Location
    Nottingham
    MS-Off Ver
    OFFICE 365
    Posts
    17

    Re: Copy range from one sheet to another

    Cleared_Spread.xlsm

    Here is the attached spreadsheet

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy range from one sheet to another

    Hi, colins5286,

    each name in the list is a hyperlink to the actual worksheet.
    Maybe you could show how the hyperlinks are created - if I add a hyperlink via formula with the fitting friendly name the code works fine.

    but it doesn't seem to copy any data from the worksheets.
    Have you checked the target sheet for any result?

    Ciao,
    Holger

  7. #7
    Registered User
    Join Date
    03-31-2012
    Location
    Nottingham
    MS-Off Ver
    OFFICE 365
    Posts
    17

    Re: Copy range from one sheet to another

    Hi,

    The code I use to create the hyperlinks is:

    Please Login or Register  to view this content.
    I have checked the target sheet and there is nothing added to it. The macro runs, I get no errors, but it doesn't seem to past any data.

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy range from one sheet to another

    Hi, colins5286,

    with your sample sheet the code should be altered from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and try again.

    Ciao,
    Holger

  9. #9
    Registered User
    Join Date
    03-31-2012
    Location
    Nottingham
    MS-Off Ver
    OFFICE 365
    Posts
    17

    Re: Copy range from one sheet to another

    Hi,

    Thanks for that - it now copies the data from the worksheets, which is great. It is leaving several blank rows between each section of data though. Is there anyway of amending this?

    Thanks


    SORRY!! - Ignore this - my mistake I had set the offset to 4 instead of 1. works great now. Thanks so much for your help.
    Last edited by colins5286; 10-22-2013 at 05:18 AM. Reason: my mistake

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy range from one sheet to another

    Hi, colins5286,

    if your problem is solved by now do you mind marking this thread as Solved via Thread Tools over the first post?

    Ciao,
    Holger

+ 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. Replies: 4
    Last Post: 09-24-2013, 08:57 AM
  2. Creating a copy button to copy range of cells to a different sheet
    By 5degrees in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-15-2013, 12:21 PM
  3. [SOLVED] Copy range from multiple sheets, into a master sheet and moving over by variable col range
    By g1eagle in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2012, 01:36 PM
  4. [SOLVED] Search for heading in data sheet and copy range to corresponding sheet in master workbook
    By sans in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-07-2012, 10:02 AM
  5. Copy dynamic range from previous sheet and paste after last used row in a range
    By Mistweaver in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-04-2010, 06:24 PM

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