Hallo wonder mensen.
Ik heb en script van internet gehaald en wat aanpassingen gedaan.
Het is en Form vul ik alles in dan schrijft hij het naar en tabblad "JA"
Maar ik zou graag zien dat deze gegevens naar en ander Excel-bestand gaat.
Omdat het hoofd bestand op meerdere computers komt te staan.
Zou iemand mijn kunnen helpen.
Alvast bedankt.
Ik heb en script van internet gehaald en wat aanpassingen gedaan.
Het is en Form vul ik alles in dan schrijft hij het naar en tabblad "JA"
Maar ik zou graag zien dat deze gegevens naar en ander Excel-bestand gaat.
Omdat het hoofd bestand op meerdere computers komt te staan.
Code:
Sub Submit_Details()
unprotect
Dim shCountry As Worksheet
Dim shForm As Worksheet
Dim iCurrentRow As Integer
Dim sCountryName As String
Set shForm = ThisWorkbook.Sheets("Form")
sCountryName = shForm.Range("H22").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("L13")
.Cells(iCurrentRow, 8) = shForm.Range("H15")
.Cells(iCurrentRow, 9) = shForm.Range("H17")
.Cells(iCurrentRow, 10) = Format([Now()], "DD-MMM-YYYY HH:MM:SS")
End With
shForm.Range("H7, H9, H13, H15, H17, L13").Value = ""
MsgBox "Je gegevens zijn toegevoegd"
ThisWorkbook.Save
ende:
End Sub
Zou iemand mijn kunnen helpen.
Alvast bedankt.