hier, versuchs mal damit
Option Explicit
Sub Stunden_auflisten()
Worksheets("Auswertung").Range("A4:D300").ClearContents
Application.ScreenUpdating = False
'Einsatzplanung Bereich laden
Liste "A4:A19"
Liste "A23:A38"
Liste "A42:A57"
Liste "A61:A76"
Liste "A80:A95"
End Sub
Function Liste(rng$): 'Wochenplan Blockweise auflisten
Dim ESPl As Worksheet, ze As Integer
Dim AC As Range, wt As Integer
Set ESPl = Worksheets("Einsatzplanung")
ze = Worksheets("Auswertung").Cells(Rows.Count, 1).End(xlUp).Row
'Wochentage Blockweise abarbeiten
For wt = 3 To 15 Step 2
'Wochentage Montag - Sonntag auswerten
For Each AC In ESPl.Range(rng).Offset(0, wt - 1)
If AC = "" Or LCase(AC) = "geschlossen" Then
ElseIf Not IsNumeric(Left(AC, 1)) Then
With Worksheets("Auswertung")
ze = ze + 1
.Cells(ze, 1) = ESPl.Cells(3, wt).Value 'Datum
.Cells(ze, 2) = AC.Cells(1, 2) 'Ehrenamtler
.Cells(ze, 3) = AC.Cells(2, 2) 'Stunden
.Cells(ze, 4) = " " & AC.Cells(1, 1) 'Aktion
End With
wt = wt + 2
End If
Next AC
Next wt
End Function
|