Die übersichtlichste Variante dürfte diese sein. Eine neue Routine, die die Alte nur zweimal aufruft und den Pfad als Parameter mitbekommt. Ein paar Sachen wurden geändert.
Public
Sub
SaveSpecial()
Dim
sPath1
As
String
, sPath2
As
String
sPath1 = "L:\01_Projekte_#\01_Auftragsordner_#\"
sPath2 =
"\\10.10.100.0\Exchange\Projekte_#"
Call
SaveSpecial_mod(sPath1)
Call
SaveSpecial_mod(sPath2)
End
Sub
<strong>
</strong>
Public
Sub
SaveSpecial_mod(sPath
As
String
)
<strong> </strong>
Dim
lngYear
As
Long
, lngReturn
As
Long
Dim
strFolder
As
String
, strSubFolder
As
String
, strValue
As
String
, strFile
As
String
Dim
blnFound
As
Boolean
strValue = Split(Cells(2, 10).Text,
"-"
)(0)
strFile = Cells(2, 10).Text
For
lngYear = Year(
Date
) - 1
To
Year(
Date
) + 1
strFolder = Replace(sPath,
"#"
,
CStr
(lngYear))