+ Reply to Thread
Results 1 to 10 of 10

VBA code to report from worksheets to a cover sheet

  1. #1
    Registered User
    Join Date
    06-04-2014
    Location
    Newcastle, Australia
    MS-Off Ver
    2010
    Posts
    63

    VBA code to report from worksheets to a cover sheet

    Hi all

    I have attached a spreadsheet that I am developing to help me forecast finish dates based on resources (men) I have available and use.

    The resources are assigned in the right hand table with a drop-down list.

    The grey cells are entered manually and the green ones update automatically (this all works as intended), but as per my two sample worksheets, I would like the job number (cell B4) to report to the front worksheet, along with the resources allocated (cells B9 to B16) to the appropriate week. I would like this to occur with any worksheets I have created in workbook.

    On the worksheet 232325, there are 2 resources booked (cell B9) for 2 weeks (cell E9), so the front sheet will insert 2 in each of the days for the first two weeks (week starting 4/7/16), then 3 men for one week (week starting 18/7/16) etc.

    I expect that at any time there may be between 10 and 20 worksheets at any time.

    Hopefully my sample explains it well enough, if not please let me know and I will try and explain further.

    Any help greatly appreciated.

    Thanks, Robbo
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA code to report from worksheets to a cover sheet

    What do you want to do with overlaps? Suppose the week start date was July 11 in cell B10 on Job 232325? There would be two workers for July 4 to July 10, and two workers for the same line for July 11 to July 17 plus three workers from July 11 to July 17. Do you want to show two separate entries on the cover sheet, or do you want to show 2 for the first week and 5 for the second week?
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    06-04-2014
    Location
    Newcastle, Australia
    MS-Off Ver
    2010
    Posts
    63

    Re: VBA code to report from worksheets to a cover sheet

    Hey dflak

    The first "week starting" is entered manually, then the rest are updated based on the "No. of Weeks" entered in column E, so 4/7/16 plus two weeks is week starting 18/7/16.

    Hopefully this means there should be no overlaps, just week starting 4/7/16 2 men for two weeks, week starting 18/7/16 three men for one week, week starting 25/7/16 for two weeks.

    Hopefully this makes some sense.

    Thanks for taking the time to have a look.

    edit: I should add that the resources will actually become names, e.g. resource1 - James, resource2 - Bill etc, so they can only be assigned once within a week.

    Robbo
    Last edited by robbo1172; 06-28-2016 at 05:38 PM.

  4. #4
    Registered User
    Join Date
    06-04-2014
    Location
    Newcastle, Australia
    MS-Off Ver
    2010
    Posts
    63

    Re: VBA code to report from worksheets to a cover sheet

    Hi all

    Just wondering if anyone has been able to have a look at this for me.

    If anything needs clarification, please let me know.

    Thanks, Robbo

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA code to report from worksheets to a cover sheet

    I think this is what you want.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-04-2014
    Location
    Newcastle, Australia
    MS-Off Ver
    2010
    Posts
    63

    Re: VBA code to report from worksheets to a cover sheet

    Thanks dflac, much appreciated.

    I was hoping that each job number would only occupy one line, as per the attached sample (manually updated to show what I'm hoping for).

    If we could tweak that part, it would be exactly what I'm looking for.

    Thanks again, Robbo
    Attached Files Attached Files

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA code to report from worksheets to a cover sheet

    I'll take a look tomorrow - it's probably a matter of moving where I increment the row number down a loop.

  8. #8
    Registered User
    Join Date
    06-04-2014
    Location
    Newcastle, Australia
    MS-Off Ver
    2010
    Posts
    63

    Re: VBA code to report from worksheets to a cover sheet

    Brilliant, thanks.

    Robbo

  9. #9
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA code to report from worksheets to a cover sheet

    I think I got it this time. It was a matter of moving the row increment outside a couple of loops.

    I hope you did notice that I changed the days on row 2. They are now computed off the week commencing figure input on row 1 and formatted to "ddd dd" format. So when you change the date in cell F1, they all recalculate.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-04-2014
    Location
    Newcastle, Australia
    MS-Off Ver
    2010
    Posts
    63

    Re: VBA code to report from worksheets to a cover sheet

    Nailed it for me, exactly what I was after.

    Thanks dflak, it's much appreciated.

    Robbo

+ 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. [SOLVED] Macro to enable Find to cover areas on several worksheets as per a list
    By Craigside in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2016, 10:10 AM
  2. Replies: 2
    Last Post: 12-30-2015, 06:57 PM
  3. Agging report, openingbalance report,customer report vab code was not working
    By rana19 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2015, 03:38 AM
  4. Replies: 4
    Last Post: 08-18-2015, 10:02 AM
  5. [SOLVED] Consolidate multiple worksheets into one reference cover sheet
    By Sarah Christian in forum Excel General
    Replies: 3
    Last Post: 01-10-2014, 12:59 AM
  6. Replies: 0
    Last Post: 10-24-2012, 07:07 AM
  7. Replies: 4
    Last Post: 10-22-2012, 03:21 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