Option
Explicit
Sub
tast()
Dim
strProDef, arrProDef()
As
String
Dim
strAufNr, arrAufNr()
As
String
Dim
ws
As
Worksheet
Dim
i
As
Integer
Dim
ProjDef, AufNr
As
String
For
Each
ws
In
ThisWorkbook.Worksheets
If
Not
ws.Name =
"Startblatt"
And
Not
ws.Name =
"Vorlage"
Then
strAufNr = ws.Range(
"V5"
).Value
strAufNr = Replace(strAufNr,
" "
,
""
)
arrAufNr = Split(strAufNr,
","
)
strProDef = ws.Range(
"V6"
).Value
strProDef = Replace(strProDef,
" "
,
""
)
arrProDef = Split(strProDef,
","
)
AufNr =
""
For
i = LBound(arrAufNr)
To
UBound(arrAufNr)
AufNr = AufNr & arrAufNr(i) & Chr(13)
Next
ProjDef =
""
For
i = LBound(arrProDef)
To
UBound(arrProDef)
ProjDef = ProjDef & arrProDef(i) & Chr(13)
Next
MsgBox
"Innenaufträge: "
& AufNr &
", Projektdefinition: "
& ProjDef
Erase
arrAufNr
Erase
arrProDef
If
Not
IsArrayAllocated(arrAufNr)
Then
_
MsgBox
"arrAufNr = ungültig"
If
Not
IsArrayAllocated(arrProDef)
Then
_
MsgBox
"arrProDef = ungültig"
End
If
Next
End
Sub
Function
IsArrayAllocated(Arr
As
Variant
)
As
Boolean
On
Error
Resume
Next
IsArrayAllocated = IsArray(Arr)
And
_
Not
IsError(LBound(Arr, 1))
And
_
LBound(Arr, 1) <= UBound(Arr, 1)
End
Function