Bonjour à tous !
Voilà j'ai un code qui ne fonctionne pas, et je ne comprends pas pourquoi... Le voici :
Private TEST As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If TEST = True Then Exit Sub
If Application.Intersect(Target, Columns(7)) Is Nothing Then Exit Sub
TEST = True
If MsgBox("Do you wish to run the macro ?", vbYesNo, "Confirmation request") = vbYes Then
Dim j As Integer
j = Sheets("Sub product items details").Range("A1048576").End(xlUp).Row
For i = 1 To j
If Sheets("Sub product items details").Cells(i, 2) = Target.Value Then
Sheets("Sub product items details").Cells(i, 2).Select
Selection.Offset(1, -1).Select
Selection.EntireRow.Select
Range(Selection, Selection.End(xlDown)).Select
End If
Next i
End If
TEST = False
End Sub
La ligne qui bloque est la suivante :
Sheets("Sub product items details").Cells(i, 2).Select
Je trouve ça plutôt étonnant puisque c'est un simple select... Dans Debug, il reconnaît le i comme la bonne ligne. J'ai essayé :
MsgBox Sheets("Sub product items details").Cells(i, 2).Address
et il me trouve la bonne adresse. Mais il veut pas sélectionner la cellule. Pourquoi ?
Merci d'avance