Closed Thread
Results 1 to 7 of 7

Creating Daily report with Macro

Hybrid View

  1. #1
    Forum Contributor marc5354's Avatar
    Join Date
    11-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    217

    Creating Daily report with Macro

    Hi all

    I am looking for how Create Daily Report from Master Tracker at End of the Day.
    i have a "Report" button in report sheet. when click on report button i gives entire month data or from the first date of month to current date, with pending and cancelled files.

    what i need is whatever the date i have entered in the column with completed files only..

    Please help me...

    please refer to below given link for your reference

    https://sheet.zoho.com/view.do?file=import

    Marc.
    Attached Files Attached Files
    Last edited by marc5354; 06-06-2012 at 12:24 PM.

  2. #2
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,147

    Re: Creating Daily report with Macro

    I guess we need to check column D to identify if the data in the row is complete or not. Does that mean, we need to check if the column has a date and time in each row? If yes, its complete and should show in the Report Tab? Which are the fields that should be output?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor marc5354's Avatar
    Join Date
    11-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    217

    Re: Creating Daily report with Macro

    Yes Arlu..

    that's correct.

    Marc.

  4. #4
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,147

    Re: Creating Daily report with Macro

    Which are the fields that should be output?

  5. #5
    Forum Contributor marc5354's Avatar
    Join Date
    11-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    217

    Re: Creating Daily report with Macro

    Thanks for your help and your valuable time...

    Required fields are:

    Serial Number; Order #; Received Date & Time; Completed Date & Time; TAT and Comments

    Marc

  6. #6
    Forum Contributor marc5354's Avatar
    Join Date
    11-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    217

    Re: Creating Daily report with Macro

    Can anyone help on this...

    Please

  7. #7
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating Daily report with Macro

    One way....like so:

    Option Explicit
    
    Sub MakeReport()
    Dim wsDATA As Worksheet, LR As Long, strFrom As Date, strTo As Date
    Dim savePath As String, saveName As String
    
    savePath = "C:\2012\"       'include the final \ in this string
    
    On Error Resume Next
    With ThisWorkbook.Sheets("Report")
        Set wsDATA = ThisWorkbook.Sheets(.Range("Vendor").Value)
        If wsDATA Is Nothing Then
            MsgBox "Vendor sheet does not exist"
            Exit Sub
        End If
        saveName = wsDATA.Name & Format(Date, " MM-DD-YYYY") & ".xls"
        strFrom = .Range("FromDate").Value
        strTo = .Range("ToDate").Value + 1
    End With
    
    Application.ScreenUpdating = False
    wsDATA.Copy
    With ActiveSheet
        .Range("A:A").Value = .Range("A:A").Value
        .AutoFilterMode = False
        .Rows(7).AutoFilter
        .Rows(7).AutoFilter Field:=4, Criteria1:="=Cancelled", Operator:=xlOr, Criteria2:="=Pending"
        LR = .Range("B" & .Rows.Count).End(xlUp).Row
        If LR > 7 Then .Range("A8:A" & LR).EntireRow.Delete xlShiftUp
        .Rows(7).AutoFilter Field:=4, Criteria1:=">=" & strTo, Operator:=xlOr, Criteria2:="<" & strFrom
        LR = .Range("B" & .Rows.Count).End(xlUp).Row
        If LR > 7 Then .Range("A8:A" & LR).EntireRow.Delete xlShiftUp
        .AutoFilterMode = False
        LR = .Range("B" & .Rows.Count).End(xlUp).Row
        If LR = 7 Then
            .Range("B8") = "no data found"
        Else
            .Range("A" & LR + 1, .Range("A" & .Rows.Count).End(xlUp).Offset(, 9)).Clear
        End If
        Columns(7).Delete xlShiftToLeft
        Application.DisplayAlerts = False
        ActiveWorkbook.SaveAs savePath & saveName, xlNormal
        ActiveWorkbook.Close
        Application.ScreenUpdating = True
        MsgBox "Done, saved as: " & savePath & saveName
    End With
    
    End Sub
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

Closed 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