funcion personalizada

13/06/2015 - 23:26 por frankye | Informe spam
¡ Hola !
Intento sumar celdas que tengan un valor comprendido entre A y B (concretamente códigos postales ej: 39000 y 39999) pero la función que encontré resulta que me lo hace hasta unos valores concretos no sé porque a partir del 35000 me da #¡NUM!
 

Leer las respuestas

#1 frankye
15/06/2015 - 17:36 | Informe spam
Emilio escribió el 14/06/2015 06:09 :
Mostrar la cita
Acertaste la apuesta cambiando INTEGER por LONG Problema solucionado
la función original era:
Function Ocurrencesbetween(myrange As Range, lowestnumber As Integer, highestnumber As Integer) As Integer
Dim counter As Integer
counter = 0
For Each Cell In myrange
If Cell.Value >= lowestnumber And Cell.Value < highestnumber Then
counter = counter + 1
End If
Next Cell
Ocurrencesbetween = counter
End Function
GRACIAS!

Preguntas similares