Bonjour à tous,
J'ai un fichier excel contenant plusieurs centaines de lignes toutes sur la colonne A.
Je dois parcourir tout le fichier en effectuant le traitement suivant:

Si je rencontre le mot "Motif=" et que avant le "Motif= suivant" je rencontre une ligne contenant ASN13 alors je recopie la valeur suivant le signe "[/B]=[/B]" dans la feuille nommée ASN13 sinon je recopie cette valeur dans la feuille ASN14.

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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
        Motif=2940x8             SOcyzt01400001       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- V2
            SIOUX< ASN13-- ABX13
            IPaDR0x3
       Motif=21xx             SOcyzt01400002       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x20939
       Motif=218069             SOcyzt01400003       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x4
       Motif=46x011             SOcyzt01400004       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x4048
       Motif=46x014             SOcyzt0140000       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x4049
       Motif=46x01x             SOcyzt01400006       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x400
       Motif=214996             SOcyzt0140000x       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x214x
       Motif=21043             SOcyzt01400008       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x24x8
       Motif=29403             SOcyzt01400009       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  US1-- V2
            IPaDR0x9
       Motif=29402             SOcyzt01400010       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  US1-- V2
            IPaDR0x10
       Motif=29401             SOcyzt01400011       FrontAz AB002
            Brig0x01400
            Normy0x Rob--  US1-- V2
            IPaDR0x11
       Motif=29400             SOcyzt01400012       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  US1-- V2
            IPaDR0x12
       Motif=33x63             SOcyzt01400013       FrontAz AB000
            Brig0x01400
            Normy0x Rob--  USx-- SOc-- V2
       Motif=210777             SOcyzt01400       FrontAz AB0
            Brig0x01405
            Normy0x Rob--  USx-- SOc-- V2
            SIOUX<Morn-- ASN13-- ABX13
            IPaDR0x2458
Est ce que qq1 a une idée?

Merci