Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wow, thanks!! that should greatly optimize the workbook!!
"Charles Williams" wrote: If you have to use whole-column references it would be better to subset them to the usedrange Function SumScreened(dateCell As Long, range1 As Range, range2 As Range) As Double dim SubRange1 as range dim subrange2 as range set subrange1=intersect(Range1.parent.usedrange,range1 ) set subrange2=intersect(Range2.parent.usedrange,range2 ) SumScreened = WorksheetFunction.SumIf(subrange1, dateCell, subrange2) End Function =SumScreened(A2, A:A, C:C) Charles __________________________________________________ The Excel Calculation Site http://www.decisionmodels.com "I need help please" wrote in message ... But, if I call it like =SumScreened(A2, A2, A2) then Im defeating the purpose of including all parameters.... going back to standard style, and including actual params: Function SumScreened(dateCell As Long, range1 As Range, range2 As Range) As Double SumScreened = WorksheetFunction.SumIf(range1, dateCell, range2) End Function =SumScreened(A2, A:A, C:C) Thanks again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using dcount function within user-defined worksheet function | Excel Programming | |||
Excel - User Defined Function Error: This function takes no argume | Excel Programming | |||
Need to open the Function Arguments window from VBA for a user defined function. | Excel Programming | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |