Option
Explicit
Sub
ImportCapacityData()
Dim
Pfad
As
String
Dim
File1
As
String
Dim
wb1
As
Workbook
Dim
DatumsSpalte1
As
Range
Dim
DatumsSpalte2
As
Range
Dim
c
As
Integer
Pfad = Workbooks(
"Capacity Management_BO"
).Worksheets(
"Parameter"
).Cells(3, 2).Value
File1 = Pfad &
"Capacity Management_Clearing Operationsv2.xlsm"
With
Workbooks.Open(File1).Worksheets(
"Team capacity plan"
).Range(
"A5:DD5"
)
Set
DatumsSpalte1 = .Find(What:=Workbooks(
"Capacity Management_BO"
).Worksheets(
"Request"
).Range(
"C2"
).Value, _
LookIn:=xlFormulas, LookAt:=xlWhole)
End
With
If
Not
DatumsSpalte1
Is
Nothing
Then
Call
MsgBox(
"Zielspalte: "
& DatumsSpalte1.Column)
Else
Call
MsgBox(
"Datumswert nicht gefunden..."
, vbExclamation)
End
If
End
Sub