Option
Explicit
Dim
Marke
As
String
Public
Monat
As
String
Dim
DokPfad
As
String
Dim
DokPreis
As
String
Dim
DokName
As
String
Dim
Jahr
As
Integer
Dim
Fileext
As
String
Dim
xAlerts
As
Boolean
Dim
WorkB
As
Workbook
Dim
WBP
As
Workbook
Dim
WSP
As
Worksheet
Dim
WorkS
As
Worksheet
Dim
xSht
As
Variant
Dim
ThisPos
As
Range
Dim
ThisRow
As
Long
Dim
DokNameYear
As
String
Dim
ZeileMax
As
Long
Dim
Model
As
String
Dim
PosMod
As
Range
Dim
ModZeile
As
Long
Dim
i
As
Variant
Dim
Pfad
As
String
Sub
Monats_Abrechnung_intern_Reinach()
Set
WorkB = ThisWorkbook
Abrechnungs_Monat_intern.Show
If
Monat =
"Dezember"
And
Format(
Date
,
"mmmm"
) =
"Januar"
Then
Jahr = Year(
Date
) - 1
Else
Jahr = Year(
Date
)
End
If
Fileext =
".xlsx"
Pfad = "X:\6_Administration\Verkauf\Verkauf intern\"
DokName = (
"Monatsabrechnung intern Reinach "
& Monat &
" "
& Jahr & Fileext)
DokPfad = (Pfad & Monat & "\" & DokName)
DokPreis = (Pfad &
"Preisliste.xlsm"
)
Set
WBP = Workbooks.Open(DokPreis)
DokNameYear = (Pfad &
"Jahresabrechnung intern Reinach "
& Jahr & Fileext)
Workbooks.Add.SaveAs Filename:=DokPfad