Option
Explicit
Private
Sub
Worksheet_Change(
ByVal
Target
As
Range)
Dim
rngDV
As
Range
Dim
wertold
As
String
Dim
wertnew
As
String
Dim
Bereich1
As
Range
Dim
Bereich2
As
Range
Dim
Bereich3
As
Range
Dim
GesamtBereich
As
Range
Dim
Zeile
As
Integer
Dim
ActivCol
As
Integer
Dim
ActivRow
As
Integer
Dim
ColSitMot
As
Integer
Dim
i
As
Integer
Dim
k
As
Integer
Dim
y
As
Integer
Dim
Z
As
Integer
Set
Bereich1 = Range(
"C7:J7"
)
Set
Bereich2 = Range(
"C13:J13"
)
Set
Bereich3 = Range(
"A2"
)
Set
GesamtBereich = Union(Bereich1, Bereich2, Bereich3)
ActivCol = ActiveCell.Column
ActivRow = ActiveCell.Row
If
Not
Application.Intersect(GesamtBereich, Target)
Is
Nothing
Then
Application.EnableEvents =
False
y = 2
Z = 13
ColSitMot = 3
For
Zeile = 3
To
200
If
Worksheets(
"Giochi"
).Range(
"A"
& Zeile).Value = ActiveCell.Value
Then
Cells(ActivRow + 1, ActivCol) = Worksheets(
"Giochi"
).Cells(Zeile, 2).Value
If
Worksheets(
"DatabaseItinerario"
).Range(
"A"
& Zeile).Value = Worksheets(
"FormularioItinerario"
).Range(
"A2"
).Value
Then
For
k = 12
To
22
Worksheets(
"FormularioItinerario"
).Cells(k, ColSitMot) = Worksheets(
"DatabaseItinerario"
).Cells(Zeile, y).Value
y = y + 1
Next
k
For
ColSitMot = 3
To
10
For
k = 2
To
11
Worksheets(
"FormularioItinerario"
).Cells(k, ColSitMot) = Worksheets(
"DatabaseItinerario"
).Cells(Zeile, Z).Value
Z = Z + 1
Next
k
Next
ColSitMot
End
If
End
If
Next
Zeile
End
If
Errorhandling:
Application.EnableEvents =
True
End
Sub