F
farid2001
Dear Gentlemen
I am trying to get the CountBetween function to work with CountIfs instead
of CountIf, but I am getting nowhere.
This is what I have:
Function CountBetween1(InRange, num1, num2, InRange1, num3) As Integer
With Application.WorksheetFunction
If num1 <= num2 Then
CountBetween1 = .CountIfs(InRange, ">=" & num1) -
..CountIfs(InRange, ">" & num2) And .CountIfs(InRange1, ">=" & num3)
Else
CountBetween1 = .CountIfs(InRange, ">=" & num2) -
..CountIfs(InRange, ">" & num1) And .CountIfs(InRange1, ">=" & num3)
End If
End With
End Function
Your help will be greatly appreciated.
Regards
farid2001
I am trying to get the CountBetween function to work with CountIfs instead
of CountIf, but I am getting nowhere.
This is what I have:
Function CountBetween1(InRange, num1, num2, InRange1, num3) As Integer
With Application.WorksheetFunction
If num1 <= num2 Then
CountBetween1 = .CountIfs(InRange, ">=" & num1) -
..CountIfs(InRange, ">" & num2) And .CountIfs(InRange1, ">=" & num3)
Else
CountBetween1 = .CountIfs(InRange, ">=" & num2) -
..CountIfs(InRange, ">" & num1) And .CountIfs(InRange1, ">=" & num3)
End If
End With
End Function
Your help will be greatly appreciated.
Regards
farid2001