Results 1 to 1 of 1

VBA EXCEL SUMPRODUCT WITH DATES problem

Threaded View

JXcel84 VBA EXCEL SUMPRODUCT WITH... 07-12-2012, 05:44 PM
  1. #1
    Registered User
    Join Date
    07-12-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2003(work), Excel 2007(work), Excel 2010(home)
    Posts
    1

    VBA EXCEL SUMPRODUCT WITH DATES problem

    I Need help with the following code..

    What I would like to do is to count the number of entries by certain person(initial) for certain date(date entered). in range A1:A10 are dates of entered and B1:B10 are their initials. Im having problem with my codes i think especially with making the date as a criteria, the result is showing 0 however really it should not. I really would like to make use of the input box if possible.

    HERE IS THE CODE

    Sub GetDataEntered()
    
            Dim myFormula As String
            Dim strInitial As String
            Dim dtDateEntered As Date
    
            Format dtDateEntered, "dd/mm/yy"
                    
            strInitial = InputBox("Enter Your Initial: ")
            dtDateEntered = InputBox("Enter Date Entered: ")
                            
            myFormula = "sumproduct(--(A1:A10= """ & dtDateEntered & """),--(B1:B10= """ & strInitial & """))"
        
            MsgBox ActiveSheet.Evaluate(myFormula)
    
    End Sub
    sumproduct.xlsm
    Last edited by JXcel84; 07-12-2012 at 08:43 PM. Reason: update on problem

Thread Information

Users Browsing this Thread

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

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