+ Reply to Thread
Results 1 to 16 of 16

Automate Attached Report

  1. #1
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483

    Automate Attached Report

    Hi,
    I create the attached report "Final" which is how I would like the report to be generated. This report is created everyday so the amount of data fluctuates. (hence why i would like to create a macro for this)

    What i was planning on doing was to add the "data" to the "DATA" tab, and for the macro to generate the rest of the report... So a macro to fill out the "Summary" page

    How I generate "Summary" page:
    I create a pivot table on the data page. I want to see the "A# and Name".."Team Leader".."Centre"..."The Count of Key" & Case Category"

    In the summary page the tables which have a blue heading are the "I106" case category... and with the yellow heading "ID14"..
    With the Pivot Table I then sort it by descending by the count of key.... and then by the Centre so we then have the largest amount of key's per centre from the top...

    The Orange total's should update accordingly and the cells between the total amounts and the last "A# and Name" to be deleted so it looks good.
    We need to paste the records as special first to keep the formats in the cells.

    And the pink totals to update automatically also...

    Please see the "Blank" xls file to see how i would "start" off the report...

    hope this makes sense, i am assuming more understanding may be required. Just let me know.

    thank You
    Attached Files Attached Files
    Last edited by pr4t3ek; 01-05-2009 at 07:31 AM.
    --
    Regards
    PD

    ----- Don't Forget -----

    1. Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks

    2. Thank those who have helped you by Clicking the scales above each post.

    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

  2. #2
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    So i've got this now:
    This creates the I106 Pivot Table

    Please Login or Register  to view this content.
    But the above would need to be amended i think, because there aren't always 70 I106's, there can be more or less.

    This code copy's the contents from the pivot and paste's it as text and sorts it by descending and then by centre

    Please Login or Register  to view this content.
    Any idea how I could go about adding the result of the above to the relavent tables in the Summary page?

    thanks
    Last edited by pr4t3ek; 12-30-2008 at 03:20 AM.

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Here's a slightly different approach that will get your data. You will have to work on the formatting aspects as, to be blunt, I hate doing them!!! LOL

    Hope it gives you some ideas anyway.


    rylo
    Attached Files Attached Files

  4. #4
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    hey mate,
    I've taken the attached approach and i like it lol..

    but im just having an issue with those blanks after you run MakeID14Pivot ...... any ideas how i can get that fixed?

    cheers

    the macro's are attached to the file.

    let me know boss
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    As you have your starting point for each of the blank deletions, don't select the blanks. Using DeleteID14MELBlank() as an example try changing it to
    Please Login or Register  to view this content.
    rylo

  6. #6
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    awesome stuff!
    finally got this automated..
    I've just got two more sheets which are pretty similar to the above on the same workbook but ill work on that in the next few hours.
    have a good weekend mate! cheers! =]

  7. #7
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    okay so the above is sort of fine.
    But the issue is that sometimes there is only one record or no records so the below code
    Please Login or Register  to view this content.
    doesnt work

    I've got the attached sheet and im trying to do the "Summary-SystemError" tab but the issue is that for UCMS I106 there is the only one record so the code
    Please Login or Register  to view this content.
    goes all the way down to 65536 and that does not work.

    What do i do :S..

    Please see attached and run the Macro: MakeSummarySystemErrorI106Pivot

    Thank YOU
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    PD

    How about something like
    Please Login or Register  to view this content.
    rylo

  9. #9
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    awesome.
    But in this instance.
    CAN I106 does not have any so it copies the heading "A# AND NAME Team Leader Centre Total"
    Is there a way for it to not copy this and just have like a blank cell on the report...
    if you know what i mean..

    thats not too important though...i can do that much manually! lol...

    but yeah...there must be a way rite...

    do u understand what i mean? if not, let me know & i'll explain..

    thanks mate

  10. #10
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    OK how about
    Please Login or Register  to view this content.

    rylo

  11. #11
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    im getting a debug error unfortunetly with the below code
    Please Login or Register  to view this content.
    same, CAN I106

  12. #12
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    im getting a debug error unfortunetly with the below code
    Please Login or Register  to view this content.
    same, CAN I106

  13. #13
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    PD

    In future, can you please advise where the error is occurring. However, try this

    Please Login or Register  to view this content.

    rylo

  14. #14
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    Hi Rylo,
    I tried the above code but now it does not copy everything.
    I used the code:
    Please Login or Register  to view this content.
    on all the copypaste modules and it just does not copy.

    please see attached and run the macro's on the workbook. You'll see what i mean
    thank you
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    oops

    Try changing the set component to
    Please Login or Register  to view this content.
    rylo

  16. #16
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    hi,
    thanks for that

    yeah it works fine..

    i guess the problem is my subroutines which delete the blank cells....which is correct but if there isnt actually any data in one of the catogories it still deletes the blank cells,

    i guess i can put an if statements, if there is no data inserted then delete all cells in the catagory except one cell.....

    anyway, cheers mate!
    much appreciated, thank you

+ 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