Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

End If

12 réponses
Avatar
Pascal
Bonjour,
Pourquoi lorsque que j'éxécute cette macro

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End If
J'ai un message End If sans bloc If. Je comprends pas j'ai bien mes deux
Blocs??

Merci
Pascal




---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 000728-3, 29/03/2007
Analyse le : 30/03/2007 09:56:12
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com

10 réponses

1 2
Avatar
Phil
Bonjour !
il te suffit d'inverser le next et le end if....

For each....
if then

end if
Next

Voila...

"Pascal" a écrit dans le message de news:
460cc2d9$0$25913$
Bonjour,
Pourquoi lorsque que j'éxécute cette macro

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End If
J'ai un message End If sans bloc If. Je comprends pas j'ai bien mes deux
Blocs??

Merci
Pascal



---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 000728-3, 29/03/2007
Analyse le : 30/03/2007 09:56:12
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com





Avatar
Jacky
Bonjour,

Il y a plusieurs erreurs dans ce code
1- supprimer end if ( if condition then résultat est sur la même ligne ,
pas besoin de "end if")
2-[VacDéb] doit existé, à priori ce serait [A2:J32].
3- If c* >= cel And c <= cel.Offset(0, 2) Then c*.Interior.ColorIndex = 34
*c= ?????
Que veux-tu peinturlurer réellement et avec quelle condition ??
--
Salutations
JJ


"Pascal" a écrit dans le message de news:
460cc2d9$0$25913$
Bonjour,
Pourquoi lorsque que j'éxécute cette macro

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End If
J'ai un message End If sans bloc If. Je comprends pas j'ai bien mes deux
Blocs??

Merci
Pascal



---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 000728-3, 29/03/2007
Analyse le : 30/03/2007 09:56:12
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com





Avatar
JB
Bonjour,


2 syntaxes pour If

If condition Then
...
Else
...
End If

et sur une seule ligne, pas de End If:

If condition Then ......


Sur ton exemple, Il faut supprimer le 2eme End If

JB



On 30 mar, 09:56, "Pascal" wrote:
Bonjour,
Pourquoi lorsque que j'éxécute cette macro

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End If
J'ai un message End If sans bloc If. Je comprends pas j'ai bien mes deux
Blocs??

Merci
Pascal

---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 000728-3, 29/03/2007
Analyse le : 30/03/2007 09:56:12
avast! - copyright (c) 1988-2007 ALWIL Software.http://www.avast.com


Avatar
Steph
Essaye ceci

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then
c.Interior.ColorIndex = 34
Next cel
End If




"Pascal" a écrit dans le message de news:
460cc2d9$0$25913$
Bonjour,
Pourquoi lorsque que j'éxécute cette macro

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End If
J'ai un message End If sans bloc If. Je comprends pas j'ai bien mes deux
Blocs??

Merci
Pascal



---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 000728-3, 29/03/2007
Analyse le : 30/03/2007 09:56:12
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com





Avatar
LSteph
Bonjour,
Lorsqu'on écrit un simple
If ..Then....sur une même ligne
pas besoin d'End if

On ne voit pas la définition de c ni cel
cel serait la Cell de la boucle dans le range [VacDéb]

Sub marqueJours()
Dim cel as range, c as range
'c=???
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End Sub

'lSteph

Bonjour,
Pourquoi lorsque que j'éxécute cette macro

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End If
J'ai un message End If sans bloc If. Je comprends pas j'ai bien mes deux
Blocs??

Merci
Pascal




---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 000728-3, 29/03/2007
Analyse le : 30/03/2007 09:56:12
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com





Avatar
Jacky
CQADED

--
Salutations
JJ


"LSteph" a écrit dans le message de news:

Bonjour,
Lorsqu'on écrit un simple
If ..Then....sur une même ligne
pas besoin d'End if

On ne voit pas la définition de c ni cel
cel serait la Cell de la boucle dans le range [VacDéb]

Sub marqueJours()
Dim cel as range, c as range
'c=???
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex = 34
Next cel
End Sub

'lSteph

Bonjour,
Pourquoi lorsque que j'éxécute cette macro

Sub marqueJours()
Application.ScreenUpdating = False
[A2:J32].Interior.ColorIndex = xlNone
For Each cel In [VacDéb]
If c >= cel And c <= cel.Offset(0, 2) Then c.Interior.ColorIndex =
34
Next cel
End If
J'ai un message End If sans bloc If. Je comprends pas j'ai bien mes deux
Blocs??

Merci
Pascal ---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 000728-3, 29/03/2007
Analyse le : 30/03/2007 09:56:12
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com






Avatar
LSteph
Spich Franch???

CQADED



Avatar
LSteph
je viens de comprendre,
Ce qui a déjà été dit,

Tu ne crois pas si bien dire, c'est la troisième fois que je le poste
hier
10:20
14:40
puis ce matin
puisqu'il n'apparait toujours pas!

@+

CQADED



Avatar
Jacky
Ce Qui A Déjà Etait Demandé
Même dans le nouveau fil
;-((
--
Salutations
JJ


"LSteph" a écrit dans le message de news:
%
Spich Franch???

CQADED





Avatar
LSteph
:-[[[
Oui mais moi "Môssieu" je donnais une réponse complète depuis hier 10:20
(à ce moment là j'étais le premier sur le coup)..que je croyais.
-Le pourquoi du If
-l'absence de définition de variable
-la correction du code proposé
et c'est pas ma faute si elle n'apparaît pas, donc je l'ai repostée!

;o))Bon Samedi quand même

lSteph

Ce Qui A Déjà Etait Demandé
Même dans le nouveau fil
;-((


1 2