Sub
Verteile()
Dim
i
As
Long
Dim
anfang
As
Long
Dim
ende
As
Long
Dim
suche
Dim
suche2
Dim
suche3
Dim
gefunden
As
Boolean
Application.ScreenUpdating =
False
Set
suche = Worksheets(
"Tabelle1"
).Columns(23).Find(
"A"
, lookat:=xlWhole, LookIn:=xlValues)
Set
suche2 = Worksheets(
"Tabelle1"
).Columns(23).Find(
"B"
, lookat:=xlWhole, LookIn:=xlValues)
Set
suche3 = Worksheets(
"Tabelle1"
).Columns(23).Find(
"C"
, lookat:=xlWhole, LookIn:=xlValues)
If
suche =
"A"
Or
suche2 =
"B"
Then
With
Tabelle1
For
i = 10
To
22
Worksheets.Add After:=Sheets(Sheets.Count)
.UsedRange.Columns(i).Copy ActiveSheet.Cells(1, 5)
ActiveSheet.Name = Cells(1, 5)
Next
End
With
End
If
If
suche3 =
"C"
Then
With
Tabelle1
For
i = 1
To
4
Worksheets.Add After:=Sheets(Sheets.Count)
.UsedRange.Range(
"A:D"
).Copy ActiveSheet.Cells(1)
.UsedRange.Columns(i + 18).Copy ActiveSheet.Cells(1, 5)
ActiveSheet.Name = Cells(1, 5) &
"C"
Next
End
With
End
If
End
Sub