Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sumproduct or sumif in vba
I'm taking a long shot here but my question is
can sumproduct or sumif be used in VBA with a User filling in the blanks with selections or text he/she has entered? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
sumproduct or sumif in vba
Hi
If you mean you want to use the SumIf function in VBA then yes you can. One way is with the Evaluate function which will also allow you to build the string from variables your user can set. Example would be: strCriteriaRange = "Sheet1!A1:A10" strCriteriaValue = "a" strSumRange = "Sheet1!B1:B10" MsgBox Evaluate("sumif(" & strCriteriaRange & ",""" & strCriteriaValue & """," & strSumRange & ")") This will return the same value as if you put =SumIf(Sheet1!A1:A10,"a",Sheet1!B1:B10) into a cell in the spreadsheet. HTH Barry "hellZg8" wrote: I'm taking a long shot here but my question is can sumproduct or sumif be used in VBA with a User filling in the blanks with selections or text he/she has entered? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sumproduct or sumif I need help, Thank you | Excel Discussion (Misc queries) | |||
SumIf or SumProduct | Excel Discussion (Misc queries) | |||
HELP !!! SUMIF or SUMPRODUCT | Excel Discussion (Misc queries) | |||
Sumif or Sumproduct | Excel Worksheet Functions | |||
SUMIF or SUMPRODUCT or something else? | Excel Worksheet Functions |