Sub
Artikelzuordnung()
Dim
s
As
Integer
Dim
i
As
Integer
ThisWorkbook.Worksheets(
"query_export_results"
).Activate
i = 2
Do
While
Cells(i, 1) <>
" "
s = 2
Do
While
Cells(s, 1) <>
" "
If
Cells(i, 1).Value = Worksheets(
"Material Information"
).Cells(s, 1)
Then
If
Worksheets(
"Material Information"
).Cells(s, 3).Value =
"Yes"
Then
Worksheets(
"Material Information"
).Cells(s, 10).Copy Destination:=Worksheets _
(
"query_export_results"
).Cells(i, 3)
Else
Worksheets(
"Material Information"
).Cells(s, 5).Copy Destination:=Worksheets _
(
"query_export_results"
).Cells(i, 4)
Worksheets(
"Material Information"
).Cells(s, 6).Copy Destination:=Worksheets _
(
"query_export_results"
).Cells(i, 5)
End
If
End
If
s = s + 1
Loop
i = i + 1
Loop
End
Sub