有一个UDF迭代列的单元格并执行原始操作。似乎一切都是正确的,但由于某种原因给出了错误#VALUE!
Function дляппр05(Diapozon As Range) As Long
'для ситуации
Application.Volatile
Dim n As Long
Dim C As Range
n = 0
For Each C In Diapozon.Rows
If С.Value = 1 And C.Offset(0, 1).Value = 1 Then
n = n + 1
End If
Next C
дляппр05 = n
End Function