Bonjour a toutes et a tous,

je reviens vers vous de nouveau pour savoir si on pouvait m'aider sur un point concernant mon code?

Je vous explique :

Voila j'ai déclaré 10 plages.

Voici un exemple :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
 
Set plagett = Range("A1").CurrentRegion
 
'********************** CP1 *************************
 
CPE1 = 1
Do While Cells(1, CPE1) <> "PORT_CPE_1"
    CPE1 = CPE1 + 1
Loop
 
Set CP1 = plagett.Columns(CPE1)
J'ai cela 10 fois a défaut de l'indice qui change a chaque fois.

Et pour ces 10 plages je dois rechercher une valeur qui est stocké dans une variable "g2r".

D'ou mon code :

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

Do While Cells(ptsuivi, colg2r) <> ""
    
    g2r = Cells(ptsuivi, colg2r).Value
    
    wbtopo.Activate
    For j = 1 To 10
        Set Trouve = Range(CP & j).Cells.Find(what:=g2r, LookAt:=xlPart) <= Erreur sur CP & j 
        If Trouve Is Nothing Then
            j = j + 1
            Else
                lg2r = Trouve.Row
                wbsuivi.shsuivi.Cells(ptsuivi, statutopo) = wbtopo.shtopo.Cells(lg2r, etopo)
                wbsuivi.shsuivi.Cells(ptsuivi, nomtopo) = wbtopo.shtopo.Cells(lg2r, ntopo)
                countcht = countcht + 1
        End If
    Next j
        
    ptsuivi = ptsuivi + 1

Loop
Auriez vous un petit TIPS pour ce petit probleme ?

En vous remerciant d'avance.

Froggy