1 | 3 |
2 | 1 |
4 | 2 |
2 | 5 |
3 | 1 |
Dim tablo As Range, c As Range
Set tablo = Worksheets("F1").Range("A1:E9")
With Worksheets("F2")
For Each c In .Range("A1:A5")
.Range("C" & c.Row) = tablo(.Range("A" & c.Row).Value, .Range("B" & c.Row).Value)
Next
End With
Private Sub Worksheet_Activate()
Application.EnableEvents = False
With [B6].CurrentRegion.Offset(1).Columns(3)
.FormulaR1C1 = "=IFERROR(INDEX(Matrice,""""&RC[-2],""""&RC[-1]),"""")"
.Value = .Value 'supprime les formules, mettre en commentaire pour les voir
End With
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheet_Activate 'lance la macro
End Sub