Aggiungo questo esempio che permette, tramite VBA di superare il limite delle tre formatazioni. L'esempio ha 5 formattazioni in base ad un range prestabilito ma se ne potrebbero creare un'infinità....
Compilate la descrizione della scadenza e la data il resto è automatico.
Scadenze.xls
E questo è il listato.
Private Sub Worksheet_Activate()
Dim oCell As Range
For Each oCell In Range("c10:c103")
riga = oCell.Row
colonna = oCell.Column
Select Case oCell.Value
Case ""
oCell.Interior.ColorIndex = 2
oCell.Font.ColorIndex = 1
Cells(riga, colonna + 2).Interior.ColorIndex = 2
Cells(riga, colonna + 4).Interior.ColorIndex = 2
Cells(riga, colonna + 2).Font.ColorIndex = 1
Cells(riga, colonna + 4).Font.ColorIndex = 1
Case Is > Cells(10, 15).Value
oCell.Interior.ColorIndex = 4
oCell.Font.ColorIndex = 1
Cells(riga, colonna + 2).Interior.ColorIndex = 4
Cells(riga, colonna + 4).Interior.ColorIndex = 4
Cells(riga, colonna + 2).Font.ColorIndex = 1
Cells(riga, colonna + 4).Font.ColorIndex = 1
Case Is > Cells(11, 15).Value
oCell.Interior.ColorIndex = 6
oCell.Font.ColorIndex = 1
Cells(riga, colonna + 2).Interior.ColorIndex = 6
Cells(riga, colonna + 4).Interior.ColorIndex = 6
Cells(riga, colonna + 2).Font.ColorIndex = 1
Cells(riga, colonna + 4).Font.ColorIndex = 1
Case Is > Cells(12, 15).Value
oCell.Interior.ColorIndex = 44
oCell.Font.ColorIndex = 1
Cells(riga, colonna + 2).Interior.ColorIndex = 44
Cells(riga, colonna + 4).Interior.ColorIndex = 44
Cells(riga, colonna + 2).Font.ColorIndex = 1
Cells(riga, colonna + 4).Font.ColorIndex = 1
Case Is > Cells(13, 15).Value
oCell.Interior.ColorIndex = 3
Cells(riga, colonna + 4).Font.ColorIndex = 2
Cells(riga, colonna + 2).Interior.ColorIndex = 3
Cells(riga, colonna + 4).Interior.ColorIndex = 3
oCell.Font.ColorIndex = 2
Cells(riga, colonna + 2).Font.ColorIndex = 2
Cells(riga, colonna + 4).Font.ColorIndex = 2
Case Is <= Cells(14, 15).Value
oCell.Interior.ColorIndex = 1
oCell.Font.ColorIndex = 2
Cells(riga, colonna + 4).Font.ColorIndex = 2
Cells(riga, colonna + 2).Interior.ColorIndex = 1
Cells(riga, colonna + 4).Interior.ColorIndex = 1
Cells(riga, colonna + 2).Font.ColorIndex = 2
Cells(riga, colonna + 4).Font.ColorIndex = 2
End Select
Next oCell
Sheets("Scadenze").Range("C10:G103").Select
Selection.Sort Key1:=Sheets("Scadenze").Range("C10"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Cells(1, 1).Select
End Sub
[Modificato da Bryan Fury 10/05/2005 23.52]