+ Reply to Thread
Results 1 to 8 of 8

VBA - Appending weekly worksheet data to master sheet

  1. #1
    Registered User
    Join Date
    02-21-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    VBA - Appending weekly worksheet data to master sheet

    Hi there,

    I've searched fruitlessly for a week for a solution to the below:

    I've a workbook with two sheets 1)'weekly' and 2)'summary.'

    Weekly is divided into products (up to a maximum of 8) with a fixed number of columns (4) directly below but a varying number of rows beneath as follows:

    Product A (main header)
    Issue|Serial Number|Analysis|Comments
    data|data|data|data
    data|data|data|data
    data|data|data|data
    data|data|data|data

    --couple of blank rows--

    Product B
    Issue|Serial Number|Analysis|Comments
    data|data|data|data
    data|data|data|data
    data|data|data|data

    --couple of blank rows--

    Product C
    Issue|Serial Number|Analysis|Comments
    data|data|data|data
    data|data|data|data
    data|data|data|data
    data|data|data|data
    data|data|data|data
    data|data|data|data

    ..etc...

    This weekly data must be appended into each product's respective grouping within the 'Summary' tab. With the following small additions: 2 additional columns filled with the model and current week must be inserted beforehand:

    Product C
    Model|week|Issue|Serial Number|Analysis|Comments
    Product C|7|data|data|data|data
    Product C|7|data|data|data|data
    Product C|7|data|data|data|data
    Product C|7|data|data|data|data
    Product C|7|data|data|data|data
    Product C|7|data|data|data|data

    Summary page will contain the groupings of Product A through H. The weekly may only contain 1 (say Product D) in any given week, or all 8.

    I realize there are more efficient ways of doing this, i.e. pivot tables, creating discrete tabs for each product, etc... but I've been tasked by the higher-ups to generate the above as I've laid out. Oh and I'm assuming this will involve VBA, as the title suggests, of which I possess some knowledge.

    If anyone can point me in the right direction (perhaps something like this has already been resolved) I'd be most appreciative.

    Thanks.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA - Appending weekly worksheet data to master sheet

    Try this macro:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    02-21-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: VBA - Appending weekly worksheet data to master sheet

    Beautiful. Thank you very much Pierre.

  4. #4
    Registered User
    Join Date
    02-21-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: VBA - Appending weekly worksheet data to master sheet

    Hi there - I've just come across an issue that would seemingly involve a simple fix yet this is not the case. In the weekly tab if there is a blank row between 'Product A' and the four headers like so (and this formatting would extend to all the Products):

    Product A

    Issue Serial no. Analysis Comments
    Broken 123A456 test 3 qwerty
    Broken2 123A4556 test 8 qwerty
    Broken3 123A456 test 3 qwerty
    Broken4 123A4556 test 8 qwerty


    I assumed that to capture the contents below one would just adjust the Offset(2) to Offset(3) in line ten of the above code. For whatever reason this is not working - what results instead is the copying and pasting of the first 2 rows (the header + the first row of data). What should I adjust to capture just the data?

    Further to this - if the last listed product in the weekly tab contains no data beneath it, the macro inserts a blank line into the summary tab. Is there a way to avoid this?

    Thank you.

  5. #5
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA - Appending weekly worksheet data to master sheet

    Ok here is the modified macro
    Please Login or Register  to view this content.
    You also have to add an empty row before the first product row in Summary sheet. I don't know why but the search for the first product if finding in it row 3 instead of row 1. whith an empty row in row 1, the search works fine. In fact you can write whatever you want in that row as long as it is not the forst product name.

  6. #6
    Registered User
    Join Date
    02-21-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: VBA - Appending weekly worksheet data to master sheet

    Thank you for your time, especially given the vagueness of my requirements. I am still encountering issues. I've attached a file with a before and after example if you'd care to take a look. I think one of the sticking points is the fact that I am required to employ merged rows within the headings. (Personally, I'd just eliminate them - but at this point I must attempt to mirror what you see in the file unfortunately).

    Thanks again.
    Attached Files Attached Files

  7. #7
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA - Appending weekly worksheet data to master sheet

    See attached workbook for a working solution.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    02-21-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: VBA - Appending weekly worksheet data to master sheet

    You've cracked it. I can't thank you enough.

+ 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. Filter data from a master to multiple sheets + appending lists
    By nomwich in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-15-2013, 12:42 PM
  2. [SOLVED] Updating master sheet from weekly update sheet
    By mckennashere in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-09-2012, 07:49 PM
  3. Worksheet creation triggers addition of data to master sheet??
    By Hellraiser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2011, 05:55 PM
  4. Add Weekly Data to Master
    By aftabn10 in forum Access Tables & Databases
    Replies: 3
    Last Post: 09-27-2010, 08:33 AM
  5. [SOLVED] Appending Data from one sheet to a master sheet
    By gusto79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2005, 11:06 AM

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