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

colorier cellule aprés une recherche

1 réponse
Avatar
Le Nordiste
Bonsoir,


Je d=E9sire rechercher les cellules contenant un crit=E9re donn=E9,
marquer -couleur ou autre- la cellule trouv=E9e,
et passer au crit=E9re suivant.

j'ai dej=E0 =E7a qui tourne :

For Each Cellule In Range("C2:C710")

With Cellule.Interior
.Pattern =3D xlSolid
.PatternColorIndex =3D xlAutomatic
.ThemeColor =3D xlThemeColorAccent6
.TintAndShade =3D 0.599993896298105
.PatternTintAndShade =3D 0
End With
Critere =3D Cellule.Value
Columns("A:A").Select
Selection.Find(What:=3DCritere, After:=3DActiveCell, LookIn:=3DxlFormulas, _=

LookAt:=3DxlPart, SearchOrder:=3DxlByRows, SearchDirection:=3DxlNext, _
MatchCase:=3DFalse, SearchFormat:=3DFalse).Activate


Next Cellule

mais comment d=E9tecter quand on a trouv=E9 ?

Le Nordiste

1 réponse

Avatar
JB
Bonjour,


Sub cherche_plusieurs()
[A:C].Interior.ColorIndex = xlNone
nom = InputBox("Nom cherché?")
If nom = "" Then Exit Sub
Set c = [A:A].Find(nom, , , xlWhole)
If Not c Is Nothing Then
premier = c.Address
Do
c.Resize(, 3).Interior.ColorIndex = 4
Set c = [A:A].FindNext(c)
Loop While Not c Is Nothing And c.Address <> premier
End If
End Sub

http://boisgontierjacques.free.fr/pages_site/cellules.htm#RechercherFind

JB


On 12 mar, 16:43, Le Nordiste
wrote:
Bonsoir,

Je désire rechercher les cellules contenant un critére donné,
marquer -couleur ou autre- la cellule trouvée,
et passer au critére suivant.

j'ai dejà ça qui tourne :

For Each Cellule In Range("C2:C710")

    With Cellule.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent6
        .TintAndShade = 0.599993896298105
        .PatternTintAndShade = 0
    End With
Critere = Cellule.Value
Columns("A:A").Select
Selection.Find(What:=Critere, After:¬tiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNe xt, _
    MatchCase:úlse, SearchFormat:úlse).Activate

Next Cellule

mais comment détecter quand on a trouvé ?

Le Nordiste