Hello all,
I've made the following macro:
Function BuscarFila(Codigo As String, Rango As Range)
Dim FilaCorriente As Integer
Dim NoDeFilas As Integer
Dim FilaEquivalente As Integer
Dim Cods As Variant
Dim CodInd As Variant
FilaEquivalente = 0
FilaCorriente = 1
Do
Cods = Split(Rango.Cells(FilaEquivalente, 1), ", ")
For Each CodInd In Cods
If CodInd.Value = Codigo Then
FilaEquivalente = FilaCorriente
End If
Next CodInd
FilaCorriente = FilaCorriente + 1
Debug.Print CodInd
Loop Until ((FilaCorriente = NoDeFilas) Or (FilaEquivalente <> 0))
If FilaEquivalente <> 0 Then
MsgBox (Rango.Cells(FilaEquivalente, 1).Value)
End If
End Function
and in the line with the split function, I get an error 1004 "Application defined or Object defined error"
I'm not 100% sure what I'm missing but it's my first time using this particular function, any pointers would be appreciated.
Thanks!
Bookmarks