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:
And here is my VBA so far:
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.
Bookmarks