Bonjour,
J'essaie de trouver une cellule formattée en entier avec séparateur de milliers ("#,##0")

Si c'est une valeur entrée au clavier ... je trouve
Si c'est le résultat d'une formule ... pas moyen !!!

Voici le résultat des mes investigations :

A21=2055
A22=B22*C22 (B22=512 et C22=2)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sub rechercheAvecSearchFormat()
   Dim rngSearch As Range, rngFindValue As Range
 
   'set the search range:
   Set rngSearch = ActiveSheet.Range("A:A")
 
   Application.FindFormat.Clear
   Application.FindFormat.NumberFormat = "#,##0"
 
   Set rngFindValue = rngSearch.Find(What:=2055, LookIn:=xlValues, SearchFormat:=True)
   MsgBox rngFindValue.Address 'Génère une erreur
 
   Set rngFindValue = rngSearch.Find(What:=2055, LookIn:=xlFormulas, SearchFormat:=True)
   MsgBox rngFindValue.Address 'OK
 
   Set rngFindValue = rngSearch.Find(What:=1024, LookIn:=xlValues, SearchFormat:=True)
   MsgBox rngFindValue.Address 'Génère une erreur
 
   Set rngFindValue = rngSearch.Find(What:=1024, LookIn:=xlFormulas, SearchFormat:=True)
   MsgBox rngFindValue.Address 'Génère une erreur
 
End Sub
Merci