Atwist
Terugkerende gebruiker
- Lid geworden
- 24 jan 2006
- Berichten
- 1.055
- Besturingssysteem
- Wndows 10
- Office versie
- 2016
Hallo forumleden,
Ik heb hier een macro maar deze loopt vast maar ik zie niet wat er mis is.
Bij de rode regel gaat het mis, hij loopt vast en krijg de fout melding 424 "object vereist"
Ik heb hier een macro maar deze loopt vast maar ik zie niet wat er mis is.
Bij de rode regel gaat het mis, hij loopt vast en krijg de fout melding 424 "object vereist"
Code:
Private Sub CommandButton4_Click()
Range("A24").Select
Dim iRow As Long
'Vind de eerste lege rij in uw database
iRow = Sheets("Brand").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
'check op invoer
[COLOR="Red"]If TextBoxZonenr1.Value = "" Then[/COLOR]
TextBoxZonenr1.SetFocus
MsgBox "Voer het zone nummer in"
Exit Sub
End If
If TextBoxVolgnr1.Value = "" Then
TextBoxVolgnr1.SetFocus
MsgBox "Voer het lus volgnummer in"
Exit Sub
End If
If Trim(Me.ComboBox3.Value) = "" Then
Me.ComboBox3.SetFocus
Exit Sub
End If
If TextBoxLokatie1.Value = "" Then
TextBoxLokatie1.SetFocus
MsgBox "Voer de lokatie in"
Exit Sub
End If
If Trim(Me.ComboBox4.Value) = "" Then
Me.ComboBox4.SetFocus
Exit Sub
End If
If TextBoxIDnr1.Value = "" Then
TextBoxIDnr1.SetFocus
MsgBox "Voer ID-nummer in"
Exit Sub
End If
'copy the data to the database
With Sheets("Brand")
.Cells(iRow, 1).Value = TextBoxZonenr1.Value
.Cells(iRow, 2).Value = TextBoxVolgnr1.Value
.Cells(iRow, 3).Value = ComboBox3.Value
.Cells(iRow, 4).Value = TextBoxLokatie1.Value
.Cells(iRow, 5).Value = ComboBox4.Value
.Cells(iRow, 6).Value = TextBoxIDnr1.Value
End With
'clear the data
TextBoxZonenr1.Value = ""
TextBoxVolgnr1.Value = ""
ComboBox3.Value = ""
TextBoxLokatie1.Value = ""
ComboBox4.Value = ""
TextBoxIDnr1.Value = ""
End Sub
Laatst bewerkt: