Option
Explicit
Option
Compare Text
Type typPair
key1
As
String
* 2
key2
As
String
* 2
flag
As
Boolean
End
Type
Sub
Test01()
Dim
setOf(1
To
2)
As
typPair
Dim
i
As
Long
Dim
bolMsgbox
As
Boolean
bolMsgbox =
True
setOf(1).key1 =
"B1"
: setOf(1).key2 =
"D4"
setOf(2).key1 =
"C1"
: setOf(2).key2 =
"C4"
For
i = LBound(setOf, 1)
To
UBound(setOf, 1)
With
ThisWorkbook
setOf(i).flag = .Worksheets(
"Tabelle1"
).Range(setOf(i).key1).Text & .Worksheets(
"Tabelle2"
).Range(setOf(i).key2).Text =
"x0"
End
With
Next
i
For
i = LBound(setOf, 1)
To
UBound(setOf, 1)
If
setOf(i).flag =
False
Then
bolMsgbox =
False
:
Exit
For
End
If
Next
i
If
bolMsgbox =
True
Then
MsgBox
""
End
Sub