+ Reply to Thread
Results 1 to 3 of 3

SUMIFS with User generated date range?

  1. #1
    Registered User
    Join Date
    11-09-2011
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    42

    SUMIFS with User generated date range?

    I am trying to write a macro that will run sumifs with the criteria being provided from certain ranges on the spreadsheet. That is to say in cell F2 the user provides the starting date range, and in G2 the ending date range criteria.

    Basically, in my full macro the equation is going to change based on a users input so I need the VBA that writes the equation to use variables thus remaining dynamic based on the users input.

    Here is my excel equation which works just fine:

    Please Login or Register  to view this content.
    And here is my VBA so far:

    Please Login or Register  to view this content.
    in this example spreadsheet the dates have been named as ranges: "StartDate" and "EndDate" and the table as "TablePTEN". I suspect the issue is with the formatting of the date in the SUMIFS VBA, but after reading for a few hours and trying a few things I just can't solve it. Also I am not sure that my use of "Range(TableDOB)" in the VBA is right. I am pretty new with VBA so help me out.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-09-2011
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: SUMIFS with User generated date range?

    also the reason I have defined so many variables is that there will be multiple sumifs equations in the final macro, but here I just wanted to get the syntax down for the first.

  3. #3
    Registered User
    Join Date
    11-09-2011
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: SUMIFS with User generated date range?

    Bump...No one has anything on this? I would greatly appreciate the help.

+ 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