Hi all,
I'm trying to do what (I think, at least) is a simple VBA function in Excel.
I have two ranges that I have defined via VBA user input, and I am trying to create a SUMIFS function in VBA that functions the same as if you entered it into Excel and "dragged" the formula over.
The range of cells that determine the outcome of the SUMIFS are B7:K7, and I want the output to be written to B30:K30.
My current code that creates a "run-time error '13: Type mismatch" is below:
Range("B30:K30").Select
Range("B30:K30") = Application.WorksheetFunction.SumIfs(inventoryDollarsRange, inventoryGLCodeRange, Range("B7:K7"))
When I set the formula to only use one cell (e.g. "B7" and "B30") it works perfectly.
Any help would be most appreciated.
Thank you!
Bookmarks