I get a code from internet, and it's working good.
But I want to add some cells to it. But I get an error message in Excel.
Now I want to put something to it in H17. And when a click submit, excel give an error.
sorry for my bat English
But I want to add some cells to it. But I get an error message in Excel.
Excel Formula:
Sub Submit_Details()
If IsEmpty(Range("H7")) Then
MsgBox "Naam Veld is niet ingevuld"
GoTo ende
Else
If IsEmpty(Range("H9")) Then
MsgBox "Waar was de storing Veld is niet ingevuld"
GoTo ende
Else
If IsEmpty(Range("H11")) Then
MsgBox "Wie heeft het opgelost Veld is niet ingevuld"
GoTo ende
Else
If IsEmpty(Range("H13")) Then
MsgBox "Hoelang was de storing Veld is niet ingevuld"
GoTo ende
Else
If IsEmpty(Range("H15")) Then
MsgBox "Geef info over de storing Veld is niet ingevuld"
GoTo ende
Else
End If
End If
End If
End If
End If
Dim shCountry As Worksheet
Dim shForm As Worksheet
Dim iCurrentRow As Integer
Dim sCountryName As String
Set shForm = ThisWorkbook.Sheets("Form")
sCountryName = shForm.Range("H20").Value
Set shCountry = ThisWorkbook.Sheets(sCountryName)
iCurrentRow = shCountry.Range("A" & Application.Rows.Count).End(xlUp).Row + 1
With shCountry
.Cells(iCurrentRow, 1) = iCurrentRow - 1
.Cells(iCurrentRow, 2) = shForm.Range("H7")
.Cells(iCurrentRow, 3) = shForm.Range("L7")
.Cells(iCurrentRow, 4) = shForm.Range("H9")
.Cells(iCurrentRow, 5) = shForm.Range("H11")
.Cells(iCurrentRow, 6) = shForm.Range("H13")
.Cells(iCurrentRow, 7) = shForm.Range("H15")
.Cells(iCurrentRow, 8) = Format([Now()], "DD-MMM-YYYY HH:MM:SS")
End With
shForm.Range("H7, H9, H13, H15").Value = ""
MsgBox "Je gegevens zijn toegevoegd"
ThisWorkbook.Save
ende:
End Sub
Now I want to put something to it in H17. And when a click submit, excel give an error.
sorry for my bat English