die nachfolgende Funktion rechnet für mich (fast) richtig. Leider ist sie auch noch für das Vorjahr gültig, sie soll aber nur für das aktuelle Jahr funktionieren.
' In Zelle=FarbsummeVMA12(J10:J350;35)
Function FarbsummeVMA12(Bereich As Range, Farbe As Integer)
Dim MyDate, MyMonth
MyDate = DateSerial(Year(Date), 12, 1)
MyMonth = Month(MyDate) ' MyMonth enthält Monat als Zahl
Dim Zelle As Range
Application.Volatile
For Each Zelle In Bereich
If Zelle.Interior.ColorIndex = 35 And Month(Zelle.Offset(, -1)) = Month(MyDate) - 1 And Zelle.Offset(0, 1).Value Like "Amazon*" Then
FarbsummeVMA12 = FarbsummeVMA12 + Zelle
End If
Next
End Function
Über eine Lösung würde ich mich freuen.
Viele Grüße
Felix