É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
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
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" <daille@free.fr> a écrit dans le message de news:0b0f01c34176$c8ed5810$a501280a@phx.gbl...
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.
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
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
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" <michdenis@hotmail.com> a écrit dans le message de news:
#Za6GoXQDHA.3664@tk2msftngp13.phx.gbl...
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" <daille@free.fr> a écrit dans le message de
news:0b0f01c34176$c8ed5810$a501280a@phx.gbl...
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.
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.