Bonjour,
J'ai un problème avec la fonction OR :
Tout se passe correctement, le résultat est "ErrHandle_1:". Lorsque je demande le test sur 2 mots en écrivant :
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 Function SupprimeNumerotationLignes(Wb As Workbook, Mdl As String, NomMacro As String) Dim Debut As Integer, Fin As Integer, i As Integer Dim strVar As String With Wb.VBProject.VBComponents(Mdl).CodeModule Debut = .ProcStartLine(NomMacro, vbext_pk_Proc) Fin = .ProcCountLines(NomMacro, vbext_pk_Proc) + Debut 'Debug.Print "debut " & Debut & " fin " & Fin For i = Debut To Fin - 1 'Resultat = Resultat & .Lines(i, 1) & vbCr strVar = .Lines(i, 1) If Mid(strVar, 1) <> "ErrHandle_1:" Then strVar = Mid(strVar, 7) .ReplaceLine i, strVar Else Debug.Print strVar End If Next End With End Function
Le mot est tronqué et devient "dle:".
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 If Mid(strVar, 1) <> "ErrHandle_1:" Or Mid(strVar, 1) <> "ErrHandle:" Then
Pourriez-vous me dire quel est l'erreur dans la formulation ?
Merci
Partager