Mon problème :
Le code ci-dessous est sencé mettre une MEFC du type :
=$D$772>=Grande.Valeur(D$764:D$772;5)
Or, après exécution, je contrôle et je vois :
=$D$772>=Grande.Valeur(G$764:G$772;5)
Qui pourrait me dire où se situe l'erreur ?
D'avance merci.
==============================
Option Explicit
Dim PlG
Dim DeB
Dim FiN
Dim ZoN As Range
Dim c
Dim Mefc As Variant
Sub PlageSelection() 'A764:S772
Set PlG = Selection
With PlG
' PlG_Adresse = .Address
' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row
DeB = .Item(1).Row
FiN = .Item(PlG.Count).Row
End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN))
ZoN.FormatConditions.Delete
For Each c In ZoN
' 1ère condition :
Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _
& "D$" & ZoN.Item(1).Row & ":D$" & _
ZoN.Item(ZoN.Count).Row & ";5)"
c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc
c.FormatConditions(1).Interior.ColorIndex = 3
'...
Next c
End Sub
--
Bien amicordialement,
P. Bastard
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
michdenis
Bonjour Patrick,
ceci est suffisant :
'-------------------------- Sub PlageSelection() 'A764:S772
Dim PlG As Range, C As Range
Set PlG = Range("D764:D772") PlG.FormatConditions.Delete For Each C In PlG ' 1ère condition : Mefc = "=" & C.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & PlG.Item(1).Row & ":D$" & _ PlG.Item(PlG.Count).Row & ";5)" C.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc C.FormatConditions(1).Interior.ColorIndex = 3
'... Next C
End Sub '--------------------------
Salutations!
"Patrick BASTARD" a écrit dans le message de news: Bonsoir à tou(te)s.
Mon problème : Le code ci-dessous est sencé mettre une MEFC du type : =$D$772>=Grande.Valeur(D$764:D$772;5)
Or, après exécution, je contrôle et je vois : =$D$772>=Grande.Valeur(G$764:G$772;5)
Qui pourrait me dire où se situe l'erreur ?
D'avance merci. ============================= Option Explicit Dim PlG Dim DeB Dim FiN Dim ZoN As Range Dim c Dim Mefc As Variant Sub PlageSelection() 'A764:S772 Set PlG = Selection With PlG ' PlG_Adresse = .Address ' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row DeB = .Item(1).Row FiN = .Item(PlG.Count).Row End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN)) ZoN.FormatConditions.Delete For Each c In ZoN ' 1ère condition : Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & ZoN.Item(1).Row & ":D$" & _ ZoN.Item(ZoN.Count).Row & ";5)" c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc c.FormatConditions(1).Interior.ColorIndex = 3
'... Next c End Sub -- Bien amicordialement, P. Bastard
Bonjour Patrick,
ceci est suffisant :
'--------------------------
Sub PlageSelection() 'A764:S772
Dim PlG As Range, C As Range
Set PlG = Range("D764:D772")
PlG.FormatConditions.Delete
For Each C In PlG
' 1ère condition :
Mefc = "=" & C.Address & ">=" & "GRANDE.VALEUR(" _
& "D$" & PlG.Item(1).Row & ":D$" & _
PlG.Item(PlG.Count).Row & ";5)"
C.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc
C.FormatConditions(1).Interior.ColorIndex = 3
'...
Next C
End Sub
'--------------------------
Salutations!
"Patrick BASTARD" <pasdespambastardp@freepasdespam.fr> a écrit dans le message de news: O4xbsAOXGHA.4212@TK2MSFTNGP02.phx.gbl...
Bonsoir à tou(te)s.
Mon problème :
Le code ci-dessous est sencé mettre une MEFC du type :
=$D$772>=Grande.Valeur(D$764:D$772;5)
Or, après exécution, je contrôle et je vois :
=$D$772>=Grande.Valeur(G$764:G$772;5)
Qui pourrait me dire où se situe l'erreur ?
D'avance merci.
============================= Option Explicit
Dim PlG
Dim DeB
Dim FiN
Dim ZoN As Range
Dim c
Dim Mefc As Variant
Sub PlageSelection() 'A764:S772
Set PlG = Selection
With PlG
' PlG_Adresse = .Address
' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row
DeB = .Item(1).Row
FiN = .Item(PlG.Count).Row
End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN))
ZoN.FormatConditions.Delete
For Each c In ZoN
' 1ère condition :
Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _
& "D$" & ZoN.Item(1).Row & ":D$" & _
ZoN.Item(ZoN.Count).Row & ";5)"
c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc
c.FormatConditions(1).Interior.ColorIndex = 3
'...
Next c
End Sub
--
Bien amicordialement,
P. Bastard
'-------------------------- Sub PlageSelection() 'A764:S772
Dim PlG As Range, C As Range
Set PlG = Range("D764:D772") PlG.FormatConditions.Delete For Each C In PlG ' 1ère condition : Mefc = "=" & C.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & PlG.Item(1).Row & ":D$" & _ PlG.Item(PlG.Count).Row & ";5)" C.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc C.FormatConditions(1).Interior.ColorIndex = 3
'... Next C
End Sub '--------------------------
Salutations!
"Patrick BASTARD" a écrit dans le message de news: Bonsoir à tou(te)s.
Mon problème : Le code ci-dessous est sencé mettre une MEFC du type : =$D$772>=Grande.Valeur(D$764:D$772;5)
Or, après exécution, je contrôle et je vois : =$D$772>=Grande.Valeur(G$764:G$772;5)
Qui pourrait me dire où se situe l'erreur ?
D'avance merci. ============================= Option Explicit Dim PlG Dim DeB Dim FiN Dim ZoN As Range Dim c Dim Mefc As Variant Sub PlageSelection() 'A764:S772 Set PlG = Selection With PlG ' PlG_Adresse = .Address ' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row DeB = .Item(1).Row FiN = .Item(PlG.Count).Row End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN)) ZoN.FormatConditions.Delete For Each c In ZoN ' 1ère condition : Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & ZoN.Item(1).Row & ":D$" & _ ZoN.Item(ZoN.Count).Row & ";5)" c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc c.FormatConditions(1).Interior.ColorIndex = 3
'... Next c End Sub -- Bien amicordialement, P. Bastard
Fredo P
Bonsoir Patrick Celle ci devrait être la bonne Option Explicit
Dim PlG Dim DeB Dim FiN Dim ZoN As Range Dim c Dim Mefc As Variant Sub PlageSelection() 'A764:S772 Set PlG = Selection With PlG ' PlG_Adresse = .Address ' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row DeB = .Item(1).Row FiN = .Item(PlG.Count).Row End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN)) ZoN.FormatConditions.Delete For Each c In ZoN ' 1ère condition :ZoN.address Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & ZoN.Row & ":D$" & _ ZoN(ZoN.Count).Row & ";5)" c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc c.FormatConditions(1).Interior.ColorIndex = 3
'... Next c End Sub "Patrick BASTARD" a écrit dans le message de news:
Bonsoir à tou(te)s.
Mon problème : Le code ci-dessous est sencé mettre une MEFC du type : =$D$772>=Grande.Valeur(D$764:D$772;5)
Or, après exécution, je contrôle et je vois : =$D$772>=Grande.Valeur(G$764:G$772;5)
Qui pourrait me dire où se situe l'erreur ?
D'avance merci. ============================= > Option Explicit Dim PlG Dim DeB Dim FiN Dim ZoN As Range Dim c Dim Mefc As Variant Sub PlageSelection() 'A764:S772 Set PlG = Selection With PlG ' PlG_Adresse = .Address ' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row DeB = .Item(1).Row FiN = .Item(PlG.Count).Row End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN)) ZoN.FormatConditions.Delete For Each c In ZoN ' 1ère condition : Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & ZoN.Item(1).Row & ":D$" & _ ZoN.Item(ZoN.Count).Row & ";5)" c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc c.FormatConditions(1).Interior.ColorIndex = 3
'... Next c End Sub -- Bien amicordialement, P. Bastard
Bonsoir Patrick
Celle ci devrait être la bonne
Option Explicit
Dim PlG
Dim DeB
Dim FiN
Dim ZoN As Range
Dim c
Dim Mefc As Variant
Sub PlageSelection() 'A764:S772
Set PlG = Selection
With PlG
' PlG_Adresse = .Address
' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row
DeB = .Item(1).Row
FiN = .Item(PlG.Count).Row
End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN))
ZoN.FormatConditions.Delete
For Each c In ZoN
' 1ère condition :ZoN.address
Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _
& "D$" & ZoN.Row & ":D$" & _
ZoN(ZoN.Count).Row & ";5)"
c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc
c.FormatConditions(1).Interior.ColorIndex = 3
'...
Next c
End Sub
"Patrick BASTARD" <pasdespambastardp@freepasdespam.fr> a écrit dans le
message de news:O4xbsAOXGHA.4212@TK2MSFTNGP02.phx.gbl...
Bonsoir à tou(te)s.
Mon problème :
Le code ci-dessous est sencé mettre une MEFC du type :
=$D$772>=Grande.Valeur(D$764:D$772;5)
Or, après exécution, je contrôle et je vois :
=$D$772>=Grande.Valeur(G$764:G$772;5)
Qui pourrait me dire où se situe l'erreur ?
D'avance merci.
============================= > Option Explicit
Dim PlG
Dim DeB
Dim FiN
Dim ZoN As Range
Dim c
Dim Mefc As Variant
Sub PlageSelection() 'A764:S772
Set PlG = Selection
With PlG
' PlG_Adresse = .Address
' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row
DeB = .Item(1).Row
FiN = .Item(PlG.Count).Row
End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN))
ZoN.FormatConditions.Delete
For Each c In ZoN
' 1ère condition :
Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _
& "D$" & ZoN.Item(1).Row & ":D$" & _
ZoN.Item(ZoN.Count).Row & ";5)"
c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc
c.FormatConditions(1).Interior.ColorIndex = 3
'...
Next c
End Sub
--
Bien amicordialement,
P. Bastard
Bonsoir Patrick Celle ci devrait être la bonne Option Explicit
Dim PlG Dim DeB Dim FiN Dim ZoN As Range Dim c Dim Mefc As Variant Sub PlageSelection() 'A764:S772 Set PlG = Selection With PlG ' PlG_Adresse = .Address ' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row DeB = .Item(1).Row FiN = .Item(PlG.Count).Row End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN)) ZoN.FormatConditions.Delete For Each c In ZoN ' 1ère condition :ZoN.address Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & ZoN.Row & ":D$" & _ ZoN(ZoN.Count).Row & ";5)" c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc c.FormatConditions(1).Interior.ColorIndex = 3
'... Next c End Sub "Patrick BASTARD" a écrit dans le message de news:
Bonsoir à tou(te)s.
Mon problème : Le code ci-dessous est sencé mettre une MEFC du type : =$D$772>=Grande.Valeur(D$764:D$772;5)
Or, après exécution, je contrôle et je vois : =$D$772>=Grande.Valeur(G$764:G$772;5)
Qui pourrait me dire où se situe l'erreur ?
D'avance merci. ============================= > Option Explicit Dim PlG Dim DeB Dim FiN Dim ZoN As Range Dim c Dim Mefc As Variant Sub PlageSelection() 'A764:S772 Set PlG = Selection With PlG ' PlG_Adresse = .Address ' Nbre_Lignes = .Item(PlG.Count).Row - .Item(1).Row DeB = .Item(1).Row FiN = .Item(PlG.Count).Row End With
Set ZoN = Range(Range("D" & DeB), Range("D" & FiN)) ZoN.FormatConditions.Delete For Each c In ZoN ' 1ère condition : Mefc = "=" & c.Address & ">=" & "GRANDE.VALEUR(" _ & "D$" & ZoN.Item(1).Row & ":D$" & _ ZoN.Item(ZoN.Count).Row & ";5)" c.FormatConditions.Add Type:=xlExpression, Formula1:=Mefc c.FormatConditions(1).Interior.ColorIndex = 3
'... Next c End Sub -- Bien amicordialement, P. Bastard