Como solucvionar el error 91 en tiempo de ejecución
Y felis día del trabajador para todo el que se dedica al trabajo.
Pues eso, tengo que me presenta un error 91en tiempo de ejecución en una macro de una plantilla que tengo funcionando desde hace tiempo.
MACRO
Private Sub lista_Click()
Dim v As Variant
Dim txt As MSForms.TextBox
Dim i%
Set ws = ActiveSheet
Dim z As Integer
txtCod.Enabled = False
txtProve.Enabled = False
With ws
'Si encuentra en A el dato seleccionado en ListBox, llena los TextBox
Set b = .Range("A2:A25000").Find(lista.Value, lookat:=xlWhole, LookIn:=xlValues) '.Row
If Not b Is Nothing Then
v = Array(txtCod, txtProd, txtProve, txtFactu, DTPicker1, txtUbic, txtObser)
For i = 0 To UBound(v)
If i = 4 Then
DTPicker1 = .Cells(b.Row, i + 1)
Else
Set txt = v(i)
txt.Text = .Cells(b.Row, i + 1)
Set txt = Nothing
End If
Next
End If
End With
'If txtUbic = "" Then txtUbic = 0
txtUbic = Format(txtUbic, "Currency") 'Para formato moneda
Rem Para Marcar selecionada la linea del articulo selcionado en el ListBox
Celda = lista.List(lista.ListIndex)
Cells.Find(what:=Celda).Activate 'EN ESTA LINEA
Range(Cells(Selection.Row, 1), Cells(Selection.Row, 7)).Select
'Buscar.Enabled = False
End SubSolo presenta el error cuando click en una linea determinada del ListBox, SOLO EN ESA LO PRESENTA y lo presenta en la linea de la macro que dice : Cells.Find(what:=Celda).Activate ' EN ESTA LINEA. La 4ª de abajo hacia arriba.
¿Qué pudra ser y el porque? ¿Qué tengo que cambiar en esa HOJA O MACRO? (6 HOJAS) de productos calasificados y 3 MÁS, una de INICIO para abrir los formularios corresponndientes y 2 mas; una de AGREGAR y otra RESTAR con SU FORM de ENTRADA/SALIDA de material.


En la hoja probé eliminar esa línea de la hoja y volví a meterla y dejo de dar dicho error, ¿qué será? ¿Por qué?