runtime error 424
I could be wrong but I don't see where you have defined "myrange". That
might be it.
"steph" wrote:
Hi,
I'm having problems defining my sumif-formula. It returns a runtime error
424 and I don't know how to solve this problem. The formula is searching in
a dynamic range and has to sum the values in a number of specific columns
when the condition is met.
Enclosed you will find the part of the macro which is returning the error.
Sub cmdok_click()
Dim rij As Integer
Dim myrange As Range
Dim myselection As Range
Dim mycolumns As Range
Dim referencepoint As Range
For l = 12 To 23
Set referencepoint = Sheets("maaltijdcheques").Cells(3, l)
With Worksheets("globaal uuroverzicht")
Set mycolumns = .Range("V:AB")
End With
With Worksheets("globaal uuroverzicht")
Set myresult.FormulaR1C1 =
Application.WorksheetFunction.SumIf(myrange, " &
referencepoint.Address(external:=True, ReferenceStyle:=xlR1C1) & ", mycolumns)
End With
Cells(d, l).Formula = myresult / (Worksheets("data").R15C2 + (1 / 2))
Next
many thanks !
steph
|