Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/07/2009, 01:37
fire384
 
Fecha de Ingreso: agosto-2008
Mensajes: 3
Antigüedad: 15 años, 9 meses
Puntos: 0
Como indicar el numero de fila en la que se cumple la condicion

hola a todos:
Tengo esta rutina y necesito que ademas de si es verdadero o falso me indique en que fila del rango se cumple la condicion

Public Function EncontrarCP(CP As String, ListaCP As Range) As Boolean
Dim intÍnd As Integer
Dim intPosAl As Integer
Dim intPosDel As Integer
With ListaCP
For intÍnd = 1 To .Rows.Count
intPosDel = InStr(.Cells(intÍnd, 1), "DEL ")
intPosAl = InStr(.Cells(intÍnd, 1), " AL ")
If CP >= Trim(Mid(.Cells(intÍnd, 1), intPosDel + 3, intPosAl - 4)) Then
If CP <= Trim(Mid(.Cells(intÍnd, 1), intPosAl + 3)) Then
EncontrarCP = True

Exit Function
End If
End If
Next
End With
End Function

Saludos
Fire