Moonbeam111
Board Regular
- Joined
- Sep 24, 2018
- Messages
- 78
- Office Version
- 365
- 2010
Im trying to create a custom function that incorporates an offset. Looking at my code may make it easier to tell what I'm trying to do.
I'm not sure what I'm doing wrong. I don't get any errors but the cell I'm using the function on remains as 0. Any suggestions?
VBA Code:
Function test (rng As Range)
Dim cel As Range
Dim s As Double
For Each cel In rng
If cel = "FALSE" Then
s = s + cell.Offset(0, 3)
End If
Next cel
test = s
End Function
I'm not sure what I'm doing wrong. I don't get any errors but the cell I'm using the function on remains as 0. Any suggestions?