[VB] Bloc If

Fermé
houpel Messages postés 11 Date d'inscription mardi 26 août 2003 Statut Membre Dernière intervention 26 août 2003 - 26 août 2003 à 15:03
houpel Messages postés 11 Date d'inscription mardi 26 août 2003 Statut Membre Dernière intervention 26 août 2003 - 26 août 2003 à 15:23
bonjour à tous
kd je marke ca:
For n = 1 To r.Rows.Count
If Cells(1, 2) = Cells(2, 1) Then Cells(2, 2) = X
End If
il me dit : erreur de compilation End If sans bloc If
Pouvez vous mexpliquer pourquoi?
Merci d'avance
A voir également:

2 réponses

change le titre

[langage] erreur exécution !!!
0
houpel Messages postés 11 Date d'inscription mardi 26 août 2003 Statut Membre Dernière intervention 26 août 2003
26 août 2003 à 15:18
kel titre, je commence à apprendre le vb donc g du mal...
0
Utilisateur anonyme
26 août 2003 à 15:18
Salut,
Tout simplement parce que lorsque tu met ton if sur une seule ligne, il ne faut pas mettre de End If !
Pour corriger, tu peux faire:

If Cells(1, 2) = Cells(2, 1) Then 
     Cells(2, 2) = X 
End If 

Ou alors:

If Cells(1, 2) = Cells(2, 1) Then Cells(2, 2) = X 

Kalamit,
Parle à ma culasse, mon carter est malade. :)
0
houpel Messages postés 11 Date d'inscription mardi 26 août 2003 Statut Membre Dernière intervention 26 août 2003
26 août 2003 à 15:23
mtt il me met :
erreur d'exécution="424" objet requis
je fais koi??
0