Modificar

You might also like

You are on page 1of 1

Private Sub CommandButton1_Click()

Dim fila As Integer


Dim final As Integer
If (ComboBox1.Value) = "" Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

End If

For fila = 2 To 1000


If Hoja1.Cells(fila, 1) = "" Then
final = fila - 1
Exit For
End If
Next

For fila = 2 To final


If Val(ComboBox1.Value) = Val(Hoja1.Cells(fila, 1)) Then
Hoja1.Cells(fila, 2) = TextBox1.Text
Hoja1.Cells(fila, 3) = TextBox2.Text
Hoja1.Cells(fila, 4) = TextBox3.Text
MsgBox "su producto a sido Modificado con exito!"
Exit For

End If
Next
End Sub

You might also like