Skip to content

Instantly share code, notes, and snippets.

@tombrad
Created February 13, 2013 04:20
Show Gist options
  • Save tombrad/4942233 to your computer and use it in GitHub Desktop.
Save tombrad/4942233 to your computer and use it in GitHub Desktop.
Prototipos VBA-3-10
Private Sub ComboBox1_Click()
Hoja3.Activate
ultimo = Hoja2.Cells(1, 1)
linea = 1
For z% = 2 To ultimo
indice = z%
CodCliente = ComboBox1.ListIndex + 1
If CodCliente = Hoja2.Cells(z%, 1) Then
monto = Hoja2.Cells(z%, 4)
If Hoja2.Cells(z%, 5) = "Debe" Then
monto = -1 * monto
End If
saldo = saldo + monto
Hoja3.Cells(linea, 1) = Hoja2.Cells(indice, 1)
Hoja3.Cells(linea, 2) = Hoja2.Cells(indice, 2)
Hoja3.Cells(linea, 3) = Hoja2.Cells(indice, 3)
Hoja3.Cells(linea, 4) = Hoja2.Cells(indice, 4)
Hoja3.Cells(linea, 5) = Hoja3.Cells(indice, 5)
linea = linea + 1
End If
Next z%
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment