Results 1 to 20 of 20

Print a montly reprt for all the active names.

Threaded View

  1. #1
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Print a montly reprt for all the active names.

    Hi All.

    I need your help on this.

    I have 3 sheets.

    Data has id-names & in C column the word active.

    Results sheet has many results(about 20000 rows)

    What i need is this.

    In MonthlyReport sheet i need a macro to change automatically the name in c3, print the report and then do the same for ALL the names that exist in Data sheet range b2:b30.

    To get the results i use this recorded macro that i believe that need improovment-but i can leave with it if this is something difficult.

    Sub macro1()
    
        Range("A7").Select
        ActiveCell.FormulaR1C1 = _
            "=COUNTIFS(Results!C[2],R[-4]C[2],Results!C[4],"">0"",Results!C,"">=""&R[-6]C[2],Results!C,""<=""&R[-5]C[2])"
        Range("B7").Select
        ActiveCell.FormulaR1C1 = "=R[-4]C[1]"
        Range("C7").Select
        ActiveCell.FormulaR1C1 = _
            "=SUMIFS(Results!C[5],Results!C,R[-4]C,Results!C[2],"">0"",Results!C[-2],"">=""&R[-6]C,Results!C[-2],""<=""&R[-5]C)"
        Range("C7").Select
        Selection.AutoFill Destination:=Range("C7:D7"), Type:=xlFillDefault
        Range("C7:D7").Select
        Range("C7").Select
        ActiveCell.FormulaR1C1 = _
            "=SUMIFS(Results!C[5],Results!C3,R3C3,Results!C5,"">0"",Results!C1,"">=""&R1C3,Results!C1,""<=""&R2C3)"
        Range("C7").Select
        Selection.AutoFill Destination:=Range("C7:D7"), Type:=xlFillDefault
        Range("C7:D7").Select
        Range("D7").Select
        Sheets("MonthlyReports").Select
        Selection.Cut
        Range("E7").Select
        ActiveSheet.Paste
        Range("C7").Select
        Selection.AutoFill Destination:=Range("C7:D7"), Type:=xlFillDefault
        Range("C7:D7").Select
        Range("D7").Select
        Sheets("MonthlyReports").Select
        ActiveCell.FormulaR1C1 = _
            "=SUMIFS(Results!C[3],Results!C3,R3C3,Results!C5,"">0"",Results!C1,"">=""&R1C3,Results!C1,""<=""&R2C3)"
        Range("E7").Select
        Sheets("MonthlyReports").Select
        Selection.AutoFill Destination:=Range("E7:F7"), Type:=xlFillDefault
        Range("E7:F7").Select
        Selection.AutoFill Destination:=Range("E7:G7"), Type:=xlFillDefault
        Range("E7:G7").Select
        Range("G7").Select
        Sheets("MonthlyReports").Select
    End Sub
    Can you help me on this pls?
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Active cell equals print area, can only print all right now
    By Jeff up North in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2013, 12:34 PM
  2. Macro to Print active sheet as PDF to Active workbook and customize name
    By Scott Taylor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-17-2012, 08:52 PM
  3. [SOLVED] montly summary
    By imran in forum Excel General
    Replies: 2
    Last Post: 04-21-2006, 05:35 AM
  4. [SOLVED] print and print preview not active in file drop down
    By Bjorne in forum Excel General
    Replies: 2
    Last Post: 03-21-2006, 02:36 AM
  5. Replies: 1
    Last Post: 11-24-2005, 07:29 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