Option
Explicit
Sub
Bestellen()
Dim
Marke
As
String
Dim
WSh
As
Worksheet, WKb
As
Workbook
With
ThisWorkbook.Sheets(
"Bestellformular"
)
If
IsEmpty(.Range(
"C5"
))
Then
MsgBox (
"Bitte Anzahl einfügen!"
)
Exit
Sub
ElseIf
IsEmpty(.Range(
"D5"
))
Then
MsgBox (
"Bitte Einheit einfügen!"
)
Exit
Sub
ElseIf
IsEmpty(.Range(
"E5"
))
Then
MsgBox (
"Bitte Marke einfügen!"
)
Exit
Sub
ElseIf
IsEmpty(.Range(
"F5"
))
Then
MsgBox (
"Bitte Model einfügen!"
)
Exit
Sub
ElseIf
IsEmpty(.Range(
"I5"
))
Then
MsgBox (
"Bitte Visum einfügen!"
)
Exit
Sub
ElseIf
IsEmpty(.Range(
"K5"
))
Then
MsgBox (
"Bitte Standort einfügen!"
)
Exit
Sub
End
If
Marke = .Range(
"E5"
).Value
If
InStr(
"Finn Comfort,New Balance,FootJoy,Meindl"
, Marke) > 0
Then
Set
WKb = Workbooks.Open(
"I:\Domenic Stamm\Bestellung\Bestellformular.xlsm"
)
Set
WSh = WKb.Worksheets(Marke)
WSh.Range(
"A2"
).EntireRow.Insert
WSh.Range(
"A2"
).Resize(1, 9).Value = .Range(
"C5:K5"
).Value
WKb.Close SaveChanges:=
True
.Range(
"C5:K5"
).ClearContents
End
If
End
With
End
Sub