Bonjour a tous,

je cherche a faire un test sur toute une colonne mais dont l'indice peut changer.
J'ai fait le code suivant:

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
For Each MyCell In Range("3:3")
    If MyCell.Value Like "*Wk*" & CurrentWeek + 2 Then
    Wk2 = MyCell.Column
        Exit For
    End If
Next MyCell
 
For Each MyCell In Columns(Wk2)
  If MyCell.Offset(0, 5 - Wk2) = "United Kingdom" Or MyCell.Offset(0, 5 - Wk2) = "UK" _
       And MyCell.Offset(0, 94) = "Compal" Then
        If MyCell.Offset(0, 102 - Wk2).Value Like "*Deal Sea*" Then
        QtyOptWk2_UKCompalSea = QtyOptWk2_UKCompalSea + MyCell.Offset(0, 11).Value
        Else
        QtyOptWk2_UKCompalAir = QtyOptWk2_UKCompalAir + MyCell.Offset(0, 11).Value
        End If
      End If
Next MyCell
 
Range("A1000").Value = QtyOptWk2_UKCompalAir
Ca compile mais quand je run la macro, j'ai une erreur de type 13.
Cela vient de la variable Wk2 qui pose pb a la propriete offset.

Si quelq'un sait comment le gerer.

Merci d'avance.