Sub
Pfadhinzufügen_Click()
Dim
LoSpalte
As
Long
Dim
LoZeile
As
Long
Dim
vardatei
As
Variant
Dim
varPfad1
As
Variant
Dim
strNameSchichtprotokoll
As
String
Dim
strPfad
As
Variant
Dim
strMatrix
As
String
Dim
strZeile
As
String
Dim
strSpalte
As
String
LoZeile = 9
LoSpalte = 5
vardatei = Application.GetOpenFilename(
"Alle Dateien,*.*"
, 1,
"Auswahl digitales Schichtprotokoll"
)
varPfad1 = Left(vardatei, InStrRev(vardatei, "\"))
varPfad1 = Replace(varPfad1,
"H:"
,
"\\hv\fs"
)
strNameSchichtprotokoll = Mid(vardatei, InStrRev(vardatei, "\") + 1)
strPfad =
"'"
+ varPfad1 +
"["
+ strNameSchichtprotokoll +
"]Schichtprotokoll'!"
'setzt Pfad und Dateiname so wieder zusammen, dass direkt auf das Blatt
"Schichtprotokoll zugegriffen wird"
strMatrix =
"=INDEX("
+ strPfad +
"$G$11:$MZ$1469;"
strZeile =
"VERGLEICH($F$4&$D9;"
+ strPfad +
"$G$11:$G$1469&"
+ strPfad +
"$H$11:$H$1469;0);"
strSpalte =
"E$6)"
strPfad = strMatrix + strZeile + strSpalte
If
vardatei =
False
Then
MsgBox
"Hinzufügen wurde unterbrochen!"
, vbInformation, p_cstrAppName
Else
End
Sub