Sub
CreateOrgChart()
Dim
i
As
Integer
, j
As
Integer
, y
As
Integer
Dim
LastRow
As
Long
, LastLine
As
Long
With
ActiveSheet
LastRow = .Range(
"A1"
).SpecialCells(xlCellTypeLastCell).Row - 3
End
With
Application.ScreenUpdating =
True
Sheets(1).
Select
Sheets(1).
Select
y = 14
For
i = 2
To
LastRow
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Volker Aichele"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 4).PasteSpecial Paste:=xlPasteValues <em><strong>
End
If
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Marco Marquart"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 7).PasteSpecial Paste:=xlPasteValues
End
If
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Daniel Leppert"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 10).PasteSpecial Paste:=xlPasteValues
End
If
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Elena Weccard"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 13).PasteSpecial Paste:=xlPasteValues
End
If
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Salvatore Oliverio"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 16).PasteSpecial Paste:=xlPasteValues
End
If
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Giuseppe Oliverio"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 19).PasteSpecial Paste:=xlPasteValues
End
If
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Dennis Pfeffer"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 22).PasteSpecial Paste:=xlPasteValues
End
If
If
Sheets(1).Cells(i, 7).Value =
"MA"
And
Sheets(1).Cells(i, 8).Value =
"Hauke Tiedemann"
Then
Range(Cells(i, 3), Cells(i, 4)).Copy
Sheets(2).Cells(y + 1, 25).PasteSpecial Paste:=xlPasteValues
End
If
y = y + 1
Next
i
End
Sub