Bonjour,
J'ai crée une fonction qui me doit me retourner si j'ai une fonction sur ma ligne. Mais le résultat n'est pas convaincant.
merci pour votre aide.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Function Recher_Formule_Ligne(Ligne As Long, ColDep, ColFin) Formule = "" Range(Cells(Ligne, Range(ColDep & 1).Column), Cells(Ligne, Range(ColFin & 1).Column)).Select Dim CurCell As Object For Each CurCell In Range(Cells(Ligne, Range(ColDep & 1).Column), Cells(Ligne, Range(ColFin & 1).Column)) Formule = CurCell.HasFormula If Formule = Vrai Then GoTo 99 Next 99: Recher_Formule_Ligne = Formule End Function
Colonne A Colonne B Colonne C (Formule) Colonne C (Résultat Ligne 1 Code Libellé =Recher_Formule_Ligne(LIGNE(C1);"A";"B") FAUX Ligne 2 WSM4530 VIS SPHERIQUE DELTA 4.5LG30 - WSM4530 =Recher_Formule_Ligne(LIGNE(C2);"A";"B") FAUX Ligne 3 WSM4536 VIS SPHERIQUE DELTA 4.5LG36 - WSM4536 =Recher_Formule_Ligne(LIGNE(C3);"A";"B") FAUX Ligne 4 WSM4542 VIS SPHERIQUE DELTA 4.5LG42 - WSM4542 =Recher_Formule_Ligne(LIGNE(C4);"A";"B") FAUX Ligne 5 WTIH036 ="TETE HUMERALE DELTA 36/0 - WTIH036" =Recher_Formule_Ligne(LIGNE(C5);"A";"B") FAUX Ligne 6 WTIH042 ="TETE HUMERALE DELTA 42/0 - WTIH042" =Recher_Formule_Ligne(LIGNE(C6);"A";"B") FAUX Ligne 7 WTIH436 TETE HUMERALE DELTA 36/4 - WTIH436 =Recher_Formule_Ligne(LIGNE(C7);"A";"B") FAUX Ligne 8 WTIH442 TETE HUMERALE DELTA 42/4 - WTIH442 =Recher_Formule_Ligne(LIGNE(C8);"A";"B") FAUX Ligne 9 XC01015 ="PLAQUE ADHESIX 10X15CM" =Recher_Formule_Ligne(LIGNE(C9);"A";"B") FAUX
Sur la ligne 5,6 et 9 je devrais avori VRAI comme résultat.
Merci.
Partager