AW: Datum bedingt formatieren
26.04.2007 22:20:45
Erich
Hallo Werner,
hier mal eine VBA-Lösung:
Tabelle1
| A | B | C |
1 | 19.04.2007 | 39197 | 3 |
2 | 39.196,25 | 24.04.2007 | 4 |
3 | 01.04.2007 | x | |
4 | aaa | 26.04.2007 | |
Formeln der Tabelle |
Zelle | Formel | C1 | =AnzDatumVonBis(A1:B4;"19.04.2007";HEUTE()) | B2 | =A2 | C2 | =AnzahlDatum(A1:B4) |
|
Bedingte Formatierungen der Tabelle |
Zelle | Nr.: / Bedingung | Format | A1 | 1. / Formel ist =IstDatum(A1)*(A1<=HEUTE())*(A1>HEUTE()-8) | Abc | B1 | 1. / Formel ist =IstDatum(B1)*(B1<=HEUTE())*(B1>HEUTE()-8) | Abc |
|
(Bedingte Formatierung auf A1:B4 ausweiten)
mit dem Code (in einem Standardmodul):
Option Explicit
Function IstDatum(rng As Range)
IstDatum = IsDate(rng)
End Function
Function AnzDatumVonBis(rngB As Range, datV As Date, datB As Date) As Long
Dim rng As Range
For Each rng In rngB
If IsDate(rng) Then
If CDate(rng) >= datV And CDate(rng)
Rückmeldung wäre nett! - Grüße von Erich aus Kamp-Lintfort