HV_L
06-20-2019, 05:39 AM
Hi, I have this piece of code, then I had to move the "kosten_tbl" on the "sheet Basisgegevens"
First, the kosten_tbl was starting at A2 having 15 rows
Now I moved the kosten_tbl to the S column now I can't add items to the kosten_tbl (S1:S16) (and growing when needed)
Can someone help me out?
Thnx!
Private Sub Cmd_Toevoegen_Click()If Len(Trim(T_edit)) = 0 Then
MsgBox T_edit.Tag & " is niet ingevuld!", vbCritical, "Fout!"
T_edit.SetFocus
Exit Sub
End If
Set ws = Worksheets("Basisgegevens")
For i = 0 To LB_overzicht.ListCount - 1
If LB_overzicht.Column(0, i) = T_edit.Value Then
MsgBox "Deze kostenpost is reeds ingegeven.", vbCritical, "Fout"
Exit Sub
End If
Next i
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
ws.Cells(iRow, 1).Value = T_edit.Value
T_edit.Value = ""
LB_overzicht.List = [kosten_tbl].Value
End Sub
First, the kosten_tbl was starting at A2 having 15 rows
Now I moved the kosten_tbl to the S column now I can't add items to the kosten_tbl (S1:S16) (and growing when needed)
Can someone help me out?
Thnx!
Private Sub Cmd_Toevoegen_Click()If Len(Trim(T_edit)) = 0 Then
MsgBox T_edit.Tag & " is niet ingevuld!", vbCritical, "Fout!"
T_edit.SetFocus
Exit Sub
End If
Set ws = Worksheets("Basisgegevens")
For i = 0 To LB_overzicht.ListCount - 1
If LB_overzicht.Column(0, i) = T_edit.Value Then
MsgBox "Deze kostenpost is reeds ingegeven.", vbCritical, "Fout"
Exit Sub
End If
Next i
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
ws.Cells(iRow, 1).Value = T_edit.Value
T_edit.Value = ""
LB_overzicht.List = [kosten_tbl].Value
End Sub