Macro Condition avec date ne fonction pas

Bonjour à tous,

Je voudrais faire fonctionner ma macro avec la condition de copier toutes les lignes qui sont inférieur au 31/12/2012 mais ça ne fonctionne pas (code en rouge)

Quel quelqu'un peut m'aider ?

voici le début de ma macro :

Sub ExportDealsInProgress()

Dim Sites(12, 500)

Dim Inplace(12, 500)

Dim Proposal(12, 500)

Dim Units(12, 500)

Dim PandE(12, 500)

Dim Cash(12, 500)

Dim Success(12, 500)

Dim Date1 As Date

lignes = 10

L = 1

For i = 8 To lignes

If Sheets("Extraction totale LEADS").Range("L" & i).Formula > 25 Then

If Sheets("Extraction totale LEADS").Range("K" & i).DateValue < ("31/12/2012") Then

With Sheets("Extraction totale LEADS")

Sites(1, L) = .Range("C" & i).Value

Inplace(2, L) = .Range("F" & i).Value

Proposal(3, L) = .Range("G" & i).Value

Units(4, L) = .Range("H" & i).Value

PandE(5, L) = .Range("J" & i).Value

Cash(6, L) = .Range("I" & i).Value

Success(7, L) = .Range("L" & i).Value

L = L + 1

End With

End If

End If

Next i

'écriture données

With Sheets("Deals in Progress")

For i = 1 To L

.Range("A" & i + 11).Value = Sites(1, i)

Next i

End With

End Sub

Bonjour

essayes (non testé)

If Sheets("Extraction totale LEADS").Range("K" & i) < DateValue("31/12/2012") Then

Super ça fonctionne

Merci

Bon Ap

Rechercher des sujets similaires à "macro condition date fonction pas"