Como lograr encontrar una fila mediante un código de VBA?
Me gustaría que un dato se guardara en la fila y columna que le indique mediante un código único, tengo un código que me guarda un dato en un combobox y luego me muestra los datos de ese combo.
Private Sub ComboBox2_Change()
Application.ScreenUpdating = False
Dim var2 As String
If ComboBox2 = "" Then
Else
CommandButton1.Locked = False
Sheets("Rinventario").Activate
If ComboBox2.ListIndex < 0 Then MsgBox ("Código no existente"), _
vbInformation, "LuffyToys": GoTo SAL
var2 = ComboBox2.Column(0)
Cells.Find(What:=ComboBox2.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
If var2 = ActiveCell.Value Then
Combo_origen.ListIndex = 4
Combo_cantidad.ListIndex = 0
Me.txt_descuento.Text = Val(0)
Combo_estado.ListIndex = 0
If Combo_estado.ListIndex = 0 Then
Me.combo_entrega.ListIndex = 2
txt_lugar.Text = "Metro Baquedano"
End If
Me.txt_bodega = ActiveCell.Offset(0, 3)
Me.txt_sector = ActiveCell.Offset(0, 4)
txt_Nombre = ActiveCell.Offset(0, 1)
txt_monto = ActiveCell.Offset(0, 6)
txt_stock = Val(ActiveCell.Offset(0, 2))
txt_fecha.Text = Date
txt_Nombre.Locked = False
txt_fecha.Locked = False
Me.txt_bodega.Locked = False
Me.txt_sector.Locked = False
txt_stock.Locked = False
End If
End If
SAL:
Sheets("Ventas").Activate
Application.ScreenUpdating = True
End SubEsto me muestra en un formulario los datos que le pido gracias al filtro que realiza el combobox, lo que me gustaría hacer es guardar un dato en la misma fila(obviamente otra celda) de donde sale el dato.
1 respuesta
Respuesta de Dante Amor
2
