Bonjour,
je rencontre un soucis avec ma macro si dessous
Bien que j'ai indiqué SET sp = ...
la première recherche s'effectue correctement mais pas les autres sauf si j'ai la feuille staff active.
j'ai une erreur d'exécution 1004 à défaut
Pourriez vous s'il vous plait m'indiquer mon erreur?
merci par avance,
nomtableau = "T_Reports"
TblBD = Range(nomtableau)
For i = 1 To UBound(TblBD)
If TblBD(i, 7) > Now And TblBD(i, 7) <= Now + 56 And TblBD(i, 10) = "Y" Then
Project_ID = TblBD(i, 1)
periodid = TblBD(i, 2)
Acronym_Range = Application.Match(Project_ID, Worksheets("Projects").Range("A:A"), 0)
Acronym = Worksheets("Projects").Cells(Acronym_Range, 3)
Set Sp = Worksheets("Staff")
Set plage = Sp.Range("A1:A" & Range("A" & Rows.Count).End(xlUp).row)
valeur1 = Project_ID
valeur2 = periodid
decalage = 7 '(de A à H)
With plage
Set ici = .Find(valeur1, LookIn:=xlValues)
If Not ici Is Nothing Then
prem = ici.Address
Do
If ici.Offset(0, decalage) = valeur2 Then MsgBox Sp.Cells(ici.row, 4) & " " & Sp.Cells(ici.row, 3)
Set ici = .FindNext(ici)
Loop While Not ici Is Nothing And ici.Address <> prem
End If
End With
End If
Next