Como Modificar o Rebajar según comboboxs
¿Cómo estas?
Tengo el siguiente código que ud me ayudo hace un tiempo.. En el comboboxcodigo_reb lo que hace es que busca en la hoja registros comparando en la columna G si hay valores ceros omite la busqueda y solo muestra en el comboboxlote_reb los que son mayores a cero
La pregunta es...
Como hacer para restar lo que esta asociado a los dos combobox codigo y lote _reb .. En la columna G tengo el valor que al cambiar el comboboxlote_reb se muestra en un label
Ese valor lo quiero restar con lo que yo introduzca en un texbox y el nuevo valor restado lo agregue en la columna F ...
Código comboboxcodigo_reb
Private Sub ComboBoxCodigo_Reb_Change()
Application.ScreenUpdating = False
Dim myrange As Range, i As Integer, Celdi As Range, NameCeldi
i = Sheets("Registros").Range("A" & Rows.Count).End(xlUp).Row
Set myrange = Sheets("Registros").Range("A2:A" & i)
ComboBoxLote_Reb.Clear
Set Celdi = myrange.Find(What:=ComboBoxCodigo_Reb.Text)
If Not Celdi Is Nothing Then
NameCeldi = Celdi.Address
Do
If Cells(Celdi.Row, "G") > 0 Then
With ComboBoxLote_Reb
.AddItem Sheets("Registros").Range("B" & Celdi.Row)
.Column(1, .ListCount - 1) = Celdi.Row
End With
End If
Set Celdi = myrange.FindNext(Celdi)
Loop While Not Celdi Is Nothing And Celdi.Address <> NameCeldi
End If
If ComboBoxLote_Reb.ListCount > 0 Then
With ComboBoxLote_Reb
.Visible = True
.ListIndex = 0
End With
End If
Application.ScreenUpdating = True
End SubCódigo comboboxlote_reb
Private Sub ComboBoxLote_Reb_Change() Application.ScreenUpdating = False LabelCantidad_Reb = "" If ComboBoxLote_Reb.ListCount > 0 Then fila = ComboBoxLote_Reb.List(ComboBoxLote_Reb.ListIndex, 1) LabelCantidad_Reb = Hoja4.Cells(fila, "G") End If End Sub
1 Respuesta
Respuesta de Dante Amor
1