OVH Cloud OVH Cloud

selection en fonction de fomules

3 réponses
Avatar
daille
slt

je cherche =E0 s=E9lectionner toutes les cellues contenant une=20
formule par ex
=3Dsi.... ou =3D somme(...
qqun peut-il m'aider
Merci
daille

3 réponses

Avatar
garnote
Salut daille,

Édition / Atteindre... / Cellules...
et tu coches Formules.

Serge

"daille" a écrit dans le message de news:
00ad01c34173$6a505580$
slt

je cherche à sélectionner toutes les cellues contenant une
formule par ex
=si.... ou = somme(...
qqun peut-il m'aider
Merci
daille
Avatar
michdenis
Bonjour Daille,

Tu indiques dans la procédure le nom de ta feuille.

'----------------------
Sub SélectionnerFormule_Si()

Dim C As Range, Rg As Range, Rg1 As Range
With Worksheets("Feuil2")
Set Rg = .UsedRange.SpecialCells(xlCellTypeFormulas)
End With
For Each C In Rg
If UCase(Left(C.FormulaLocal, 4)) = "=SI(" Then
If Not Rg1 Is Nothing Then
Set Rg1 = Union(Rg1, C)
Else
Set Rg1 = C
End If
End If
Next
If Not Rg1 Is Nothing Then
Rg1.Select
End If

Set Rg = Nothing: Set Rg1 = Nothing: Set C = Nothing

End Sub
'----------------------

Salutations!




"daille" a écrit dans le message de news:0b0f01c34176$c8ed5810$
benh non c'etait trop simple
je ne veux que les =si(... par ex.

Merci

-----Message d'origine-----
Salut daille,

Édition / Atteindre... / Cellules...
et tu coches Formules.

Serge



Avatar
garnote
Une variante à la macro de michdenis :

Sub SélectionnerFormule()
Dim C As Range, Rg As Range, Rg1 As Range
formule = InputBox("Quelle formule cherchez-vous ?" & Chr(10) _
& "Exemples: SI, somme (pas de signe d'égalité)")
formule = UCase(formule)
With ActiveSheet
Set Rg = .UsedRange.SpecialCells(xlCellTypeFormulas)
End With
For Each C In Rg
If Mid(C.FormulaLocal, 2, Len(formule)) = formule Then
If Not Rg1 Is Nothing Then
Set Rg1 = Union(Rg1, C)
Else
Set Rg1 = C
End If
End If
Next
If Not Rg1 Is Nothing Then
Rg1.Select
End If
Set Rg = Nothing: Set Rg1 = Nothing: Set C = Nothing
End Sub



"michdenis" a écrit dans le message de news:
#
Bonjour Daille,

Tu indiques dans la procédure le nom de ta feuille.

'----------------------
Sub SélectionnerFormule_Si()

Dim C As Range, Rg As Range, Rg1 As Range
With Worksheets("Feuil2")
Set Rg = .UsedRange.SpecialCells(xlCellTypeFormulas)
End With
For Each C In Rg
If UCase(Left(C.FormulaLocal, 4)) = "=SI(" Then
If Not Rg1 Is Nothing Then
Set Rg1 = Union(Rg1, C)
Else
Set Rg1 = C
End If
End If
Next
If Not Rg1 Is Nothing Then
Rg1.Select
End If

Set Rg = Nothing: Set Rg1 = Nothing: Set C = Nothing

End Sub
'----------------------

Salutations!




"daille" a écrit dans le message de
news:0b0f01c34176$c8ed5810$

benh non c'etait trop simple
je ne veux que les =si(... par ex.

Merci

-----Message d'origine-----
Salut daille,

Édition / Atteindre... / Cellules...
et tu coches Formules.

Serge