¡Gracias! por tu pronta respuesta tengo el mismo conflicto de código en el botón buscar desde un botón. Agradecería tu apoyo tengo el siguiente código desde un botón buscar pero me crea conflicto desde el combobox que podría hacer te envio código:
Private Sub BtnBuscar_Click()
Dim FILA, FINAL, I As Integer
If TexBoxFolio = Empty Then
MsgBox "ES NECESARIO INGRESAR NUMERO DE FOLIO PARA REALIZAR LA BUSQUEDA", vbExclamation
TexBoxFolio.SetFocus
Exit Sub
Else
FILA = 3
Do While Hoja1.Cells(FILA, 3) <> Empty
FILA = FILA + 1
Loop
FINAL = FILA - 1
For I = 2 To FINAL
If TexBoxFolio.Text = Hoja1.Cells(I, 3) Then
ComboBoxMes.Text = Hoja1.Cells(I, 2)
TexBoxIdGasto.Text = Hoja1.Cells(I, 4)
ComboBoxCuentaContable.Text = Hoja1.Cells(I, 5)
MsgBox "DATOS CARGADOS CON EXITO!!"
Exit Sub
End If
Next I
End If
End Sub
Este es el código en el Combobox:
Private Sub ComboBoxBuscarFolio_Change()
Dim ws As Worksheet
Dim Rng As Range
Dim Sel
Set ws = Sheets("POLIZA GASTOS 2020")
Sel = Me.ComboBoxBuscarFolio.Value
If Sel <> "" Then
Set Rng = ws.Columns(4).Find(Sel, lookat:=xlWhole)
If Not Rng Is Nothing Then
Me.ComboBoxMes.Value = ws.Cells(Rng.Row, "B")
Me.TexBoxIdGasto.Value = ws.Cells(Rng.Row, "C")
Me.TexBoxFolio.Value = ws.Cells(Rng.Row, "D")
Me.ComboBoxCuentaContable.Value = ws.Cells(Rng.Row, "E")
Me.ComboBoxRazonSocial.Value = ws.Cells(Rng.Row, "F")
Me.TexBoxConceptoCompra.Value = ws.Cells(Rng.Row, "G")
Me.TexBoxNumFactura.Value = ws.Cells(Rng.Row, "H")
Me.TexBoxFecha.Value = ws.Cells(Rng.Row, "I")
Me.TexBoxImporte.Value = ws.Cells(Rng.Row, "J")
Me.TexBoxIVA.Value = ws.Cells(Rng.Row, "K")
Me.TexBoxTotal.Value = ws.Cells(Rng.Row, "L")
Me.CheckBoxBajaDctoSI.Value = ws.Cells(Rng.Row, "M")
Me.ComboBoxTipoGasto.Value = ws.Cells(Rng.Row, "N")
End If
End If
End Sub
me crea conflicto con el botón buscar y modificar Gracias por tu apoyo