Visual Basic Source Code
Sub Reset_Form()
Dim iMessage As VbMsgBoxResult
iMessage = MsgBox("Do you want to reset this form?", vbYesNo + vbQuestion, "Reset Confirmation")
If iMessage = vbNo Then Exit Sub
[Link]("Form").Range("H7, H9, H11, H13, H15, H17,H20, H23, H25, H27").Value = ""
End Sub
Sub Submit_Details()
Dim shCountry As Worksheet Dim shForm As Worksheet
Dim iCurrentRow As Integer Dim sCountryName As String
Set shForm = [Link]("Form") sCountryName = [Link]("H7").Value
Set shCountry = [Link](sCountryName)
iCurrentRow = [Link]("A" & [Link]).End(xlUp).Row + 1
With shCountry
.Cells(iCurrentRow, 1) = iCurrentRow - 1 .Cells(iCurrentRow, 2) = [Link]("H9")
.Cells(iCurrentRow, 3) = [Link]("H7")
.Cells(iCurrentRow, 4) = [Link]("H11")
.Cells(iCurrentRow, 5) = [Link]("H13") .Cells(iCurrentRow, 6) = [Link]("H17")
.Cells(iCurrentRow, 7) = [Link]("H20") .Cells(iCurrentRow, 8) = [Link]("H25")
.Cells(iCurrentRow, 9) = [Link]("H27")
.Cells(iCurrentRow, 10) = Format([Now()], "DD-MMM-YYYY HH:MM:SS")
End With
[Link]("H7, H9, H11, H13, H15, H17,H20, H23, H25, H27").Value = ""
MsgBox "Data submitted successfully!"
End Sub