En Macro Excel significado, o cual su función
Quiero que me digas cual es su función dentro de esta macro, que significa o que hace esta línea
If Not b Is Nothing Then
Private Sub lista_Click()
Dim v As Variant
Dim txt As MSForms.TextBox
Dim i%
With Sheets("Productos")
Set b = .Range("A2:A50000").Find(lista.Value, lookat:=xlWhole, LookIn:=xlValues) '.Row 'ANTES B5
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
Buscar.SetFocus
'txtCod.Enabled = False
End SubAqui según el comentario, esta claro
'Evita nombre repetido, busca si ya existe en data
Set busco = Sheets("Productos").Range("B:B").Find(txtProd.Text, LookIn:=xlValues, lookat:=xlWhole)
If Not busco Is Nothing Then 'significa que lo encontró
MsgBox ("Este código ya está registrado. Verifica ...."), vbInformation, "Existe"
'sale sin guardar
Exit Sub
End If
'xxxxxxxxx
Respuesta de Dante Amor
5
1 respuesta más de otro experto
Respuesta de Elsa Matilde
2