Input Form

Dokman

New Member
Joined
Dec 6, 2023
Messages
7
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
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.

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
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
To get more focused responses, always post the error number and message because just reading code is not enough. Also, post what you tried otherwise there's no way to know where you went wrong. Also, when posting code use vba code tags (vba button on posting toolbar) and not formula tags or something else. Consider using Google translate for English help.

Om gerichtere reacties te krijgen, moet u altijd het foutnummer en het bericht posten, omdat alleen het lezen van de code niet voldoende is. Post ook wat je hebt geprobeerd, anders kun je niet weten waar je fout bent gegaan. Gebruik bij het posten van code ook vba-codetags (vba-knop op de postwerkbalk) en geen formuletags of iets anders. Overweeg om Google Translate te gebruiken voor hulp in het Engels.
 
Upvote 0
Thanks for de replay. I have found the error and solve it.

But thanks for the explanation
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top