Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to return the sum of a range using a function "CriteriaScore".
Iam tryin to use the Cells object to specify the Range, but VB is not happy. If I define the function as follows, it works fine: Function CriteriaScore () As Integer Set MyRange = Worksheets("DecisionScores").Range("B3:F3") CiteriaScore = WorksheetFunction.Sum(MyRange) End Function However, as soon as I introduce the Cells reference, it doens't work: Function CriteriaScore () As Integer Set MyRange = Worksheets("DecisionScores").Range(Cells(3, 2), Cells(3, 6)) CiteriaScore = WorksheetFunction.Sum(MyRange) End Function Any ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
returning pivottable object from a range object | Excel Programming | |||
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? | Excel Programming | |||
Range object to Array object conversion | Excel Programming | |||
Range object to Array object conversion | Excel Programming | |||
Range object to Array object conversion | Excel Programming |