Bonjour,
Je souhaite comparer des cellules sur 2 feuilles excel et mettre une donnée dans la 3ème feuille.
J'ai commencé une macro (ci-dessous), mais j'ai une "run-time error" à l'exécution.
For cpt_lot = 0 To 15000
'Initialisation des param
Lot = Worksheets("Lot_PC").Cells((2 + cpt_lot), 1).Text
Wafer = Worksheets("Lot_PC").Cells((2 + cpt_lot), 2).Numeric
Lot_present = False
Wafer_present = False
rowsearch = 2
'Le Lot est présent dans la feuille Yield ?
While (VarType(Worksheets("Yield_Probe").Cell(rowsearch, 1)) <> 0 And VarType(Worksheets("Yield_Probe").Cell(rowsearch, 3)) <> 0)
If ((Worksheets("Yield_Probe").Cells(rowsearch, 1).Value = Lot) And (Worksheets("Yield_Probe").Cells(rowsearch, 3).Value = Wafer)) Then
Lot_present = True
Wafer_present = True
End If
rowsearch = rowsearch + 1
Wend
rowyield = 2
While (VarType(Worksheets("Yield_Probe").Cell(rowyield, 1)) <> 0 And VarType(Worksheets("Yield_Probe").Cell(rowyield, 3)) <> 0)
If ((Worksheets("Yield_Probe").Cells(rowyield, 1).Value = Lot) And (Worksheets("Yield_Probe").Cells(rowyield, 3).Value = Wafer)) Then
yield = Worksheets("Yield_Probe").Cells(rowyield, 7).Value
End If
rowyield = rowyield + 1
Wend
If ((Lot_present = True) And (Wafer_present = True)) Then
Worksheets("Lot_PC_Yield").Cells(rowsearch, 8) = yield
End If
Next cpt_lot
Merci,
Sandrillon