Sub telop()
x1 = x1 + Val(txtBedragUitsplits1.Text)
x2 = x2 + Val(txtBedragUitsplits2.Text)
x3 = x3 + Val(txtBedragUitsplits3.Text)
x4 = x4 + Cells(ActiveCell.Row, 5).Value
x = x4 - x1 - x2 - x3
Caption = "Transaktie uitsplitsen " & x
End Sub
Private Sub cmdAnnuleren_Click()
Unload Me
End Sub
Private Sub cmdOkenUitsplitsen_Click()
Application.ScreenUpdating = False
x1 = x1 + Val(txtBedragUitsplits1.Text)
x2 = x2 + Val(txtBedragUitsplits2.Text)
x3 = x3 + Val(txtBedragUitsplits3.Text)
With Sheets("jan")
If x1 > 0 Then
.Range("e" & ActiveCell.Row).Value = ""
With .Range("e" & ActiveCell.Row).Interior
.Color = 255
End With
.Range("a" & ActiveCell.Row).Offset(1, 0).EntireRow.Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.Range("a" & ActiveCell.Row).Offset(-1, 0).EntireRow.Copy Destination:=Range("a" & ActiveCell.Row)
.Range("b" & ActiveCell.Row).Value = Me.txtGeselecteerdeTransaktieDatum
.Range("c" & ActiveCell.Row).Value = Me.txtGeselecteerdeTransaktieOmschrijving
.Range("d" & ActiveCell.Row).Value = Me.txtMededelingUitsplits1
.Range("e" & ActiveCell.Row).Value = x1
With Range("e" & ActiveCell.Row).Interior
.Pattern = xlNone
End With
.Range("f" & ActiveCell.Row).Value = Me.txtBijAfUitsplits1
End If
If x2 > 0 Then
.Range("a" & ActiveCell.Row).Offset(1, 0).EntireRow.Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.Range("a" & ActiveCell.Row).Offset(-1, 0).EntireRow.Copy Destination:=Range("a" & ActiveCell.Row)
.Range("b" & ActiveCell.Row).Value = Me.txtGeselecteerdeTransaktieDatum
.Range("c" & ActiveCell.Row).Value = Me.txtGeselecteerdeTransaktieOmschrijving
.Range("d" & ActiveCell.Row).Value = Me.txtMededelingUitsplits2
.Range("e" & ActiveCell.Row).Value = x2
With Range("e" & ActiveCell.Row).Interior
.Pattern = xlNone
End With
.Range("f" & ActiveCell.Row).Value = Me.txtBijAfUitsplits2
End If
If x3 > 0 Then
.Range("a" & ActiveCell.Row).Offset(1, 0).EntireRow.Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.Range("a" & ActiveCell.Row).Offset(-1, 0).EntireRow.Copy Destination:=Range("a" & ActiveCell.Row)
.Range("b" & ActiveCell.Row).Value = Me.txtGeselecteerdeTransaktieDatum
.Range("c" & ActiveCell.Row).Value = Me.txtGeselecteerdeTransaktieOmschrijving
.Range("d" & ActiveCell.Row).Value = Me.txtMededelingUitsplits3
.Range("e" & ActiveCell.Row).Value = x3
With Range("e" & ActiveCell.Row).Interior
.Pattern = xlNone
End With
.Range("f" & ActiveCell.Row).Value = Me.txtBijAfUitsplits3
End If
End With
Application.ScreenUpdating = True
Unload Me
End Sub
Private Sub txtBedragUitsplits1_Change()
telop
End Sub
Private Sub txtBedragUitsplits2_Change()
telop
End Sub
Private Sub txtBedragUitsplits3_Change()
telop
End Sub
Private Sub UserForm_Initialize()
ar = Sheets("jan").Range("B" & ActiveCell.Row).Resize(, 5)
txtGeselecteerdeTransaktieDatum = ar(1, 1)
txtGeselecteerdeTransaktieOmschrijving = ar(1, 2)
txtGeselecteerdeTransaktieMededeling = ar(1, 3)
txtGeselecteerdeTransaktieBedrag = ar(1, 4)
txtGeselecteerdeTransaktieBijAf = ar(1, 5)
txtDatumUitsplits1.Value = Format(CDate(Range("b1").Value), "dd/mm/yyyy")
With Me.txtMededelingUitsplits1
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub