Private
Sub
Worksheet_SelectionChange(
ByVal
Target
As
Range)
Dim
c
As
Range
Dim
firstAddress
As
String
, Find
As
String
Dim
wksMA1
As
Worksheet
Dim
iSheet
As
Integer
Dim
iRowL
As
Long
, iRow
As
Long
Set
wksMA1 = ThisWorkbook.Sheets(
"MA1"
)
iRowL = wksMA1.Cells(Rows.Count, 1).
End
(xlUp).Row
For
iRow = 2
To
iRowL
If
wksMA1.Cells(iRow, 3) > 0
Then
Find = wksMA1.Cells(iRow, 1)
For
iSheet = wksMA1.Index + 1
To
Worksheets.Count
With
Worksheets(iSheet).Range(
"A1:A500"
)
Set
c = .Find(Find, LookAt:=xlWhole)
If
Not
c
Is
Nothing
Then
firstAddress = c.Address
MsgBox (Find &
" gefunden bei "
& Worksheets(iSheet).Name & c.Address)
c.Offset(0, 1).Value = wksMA1.Cells(iRow, 2)
c.Offset(0, 4).Value = wksMA1.Cells(iRow, 5)
c.Offset(0, 5).Value = wksMA1.Cells(iRow, 6)
c.Offset(0, 6).Value = wksMA1.Cells(iRow, 7)
End
If
End
With
Next
iSheet
End
If
Next
iRow
End
Sub