Pb de qualificateur incorrect

Bonjour,

J'ai écris un code afin de calculer un prix de revient au km d'une voiture sur une période définie par l'utilisateur. Pour ce faire voici le code :

 
Dim x1 As Long
Dim x2 As Long
Dim Cell1 As Variant
Dim Cell2 As Date
Dim Cell3 As Date
Dim Cell4 As Long
Dim Cell5 As Variant
Dim Cell6 As Long
Dim Cell7 As Long
Dim Cell8 As Long
Dim Cell9 As Long
Dim I3 As Long
Dim J3 As Long
Dim G3 As Date
Dim H3 As Date
Dim F3 As Variant

Set Cell1.Value = Sheets("Voiture").Range("A6:A10000").Value
Set Cell2.Value = Sheets("Voiture").Range("B6:B10000").Value
Set Cell3.Value = Sheets("Voiture").Range("K6:K10000").Value
Set Cell4.Value = Sheets("Voiture").Range("J6:J10000").Value
Set Cell5.Value = Sheets("Inventaire").Range("B6:B10000").Value
Set Cell6.Value = Sheets("Inventaire").Range("E6:E10000").Value
Set Cell7.Value = Sheets("Inventaire").Range("F6:F10000").Value
Set Cell8.Value = Sheets("Inventaire").Range("G6:G10000").Value
Set Cell9.Value = Sheets("Inventaire").Range("H6:H10000").Value
Set I3.Value = Sheets("Inventaire").Range("I3").Value
Set J3.Value = Sheets("Inventaire").Range("J3").Value
Set G3.Value = Sheets("Inventaire").Range("G3").Value
Set H3.Value = Sheets("Inventaire").Range("H3").Value
Set F3.Value = Sheets("Inventaire").Range("F3").Value

For Each F3 In Cell1

    If G3 <= Cell2 And H3 >= Cell3 Then x1 = Cell4 + x1

Next

For Each F3 In Cell5

    x2 = Cell6 + Cell7 + Cell8
    I3 = x1 + x2
    J3 = I3 / Cell9

Next

End Sub

J'ai surligné l'endroit où le pb de qualificateur incorrect intervient, de plus en changeant le.Value, je rencontre des pbs d'odjet requis.

J'espère que vous pouvez m'aider, merci pour le temps accordé à ce post.

Bien cordialement.

Bonjour,

On t'accordera du temps quand tu en auras accordé pour faire un retour sur ton topic https://forum.excel-pratique.com/excel/pb-de-qualificateur-t75724.html

Même sujet d'ailleurs...

eric

J'ai testé le code que tu m'avais donné mais j'ai encore une erreur.. Du coup j'ai contacté un autre inscrit sur le forum, pour qu'il m'aide sur le sujet :/

Y a t il quelque chose de spécial à faire pour fermer l'autre discussion ?

La moindre des correction est de faire un retour à ceux qui ont pris du temps pour t'aider.

Du mal à être une évidence pour certains...

Rechercher des sujets similaires à "qualificateur incorrect"