Sub
datenübertragen()
Dim
ws
As
Worksheet
Dim
lastrow
As
Long
On
Error
Resume
Next
Set
ws = ThisWorkbook.Worksheets([D15].Value)
On
Error
GoTo
0
If
Not
ws
Is
Nothing
Then
lastrow = ws.Cells(ws.Rows.Count, 2).
End
(xlUp).Row
ws.Cells(lastrow + 1,
"I"
).Value = [D9]
ws.Cells(lastrow + 1,
"B"
).Value = [G9]
ws.Cells(lastrow + 1,
"D"
).Value = [G11]
ws.Cells(lastrow + 1,
"F"
).Value = [G13]
ws.Cells(lastrow + 1,
"E"
).Value = [G15]
MsgBox
"Datensatz eingetragen"
ThisWorkbook.Worksheets(
"Ersatzteil anlegen"
).Range(
"G9,G11,G13,G15"
).Value = vbNullString
Else
MsgBox
"Tabelle nicht verfügbar"
End
If
End
Sub