C
c1802362
I wrote this function to count every instance of any cell (column 2)
in a range that starts with "OPEN".
For some reason, the function sums correctly but won't return the sum
(variable "X").
On the excel spreadsheet, the cell where I want the sum is '=findme()'
I've tried some generic UDFs and they work fine, so what am I missing?
Art
**************************************
Function findme() As Integer
Range("A1").Select
x = 0
RowCount = Selection.CurrentRegion.Rows.Count
For i = 2 To RowCount
If Left(ActiveCell.Offset(i - 1, 1), 4) = "OPEN" Then
x = x + 1
End If
Next i
findme = x
End Function
in a range that starts with "OPEN".
For some reason, the function sums correctly but won't return the sum
(variable "X").
On the excel spreadsheet, the cell where I want the sum is '=findme()'
I've tried some generic UDFs and they work fine, so what am I missing?
Art
**************************************
Function findme() As Integer
Range("A1").Select
x = 0
RowCount = Selection.CurrentRegion.Rows.Count
For i = 2 To RowCount
If Left(ActiveCell.Offset(i - 1, 1), 4) = "OPEN" Then
x = x + 1
End If
Next i
findme = x
End Function