1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Option Explicit
Dim tablo() As Variant
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Feuil2" Then
On Error GoTo fin
Sheets("Feuil2").Range(Cells(1, 1), Cells(UBound(tablo), UBound(tablo, 2))).Value = tablo
Erase tablo
End If
fin:
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = "Feuil1" Then
Sheets("Feuil2").Range("A1").CurrentRegion.ClearContents
If Target.Count > 1 Then
Erase tablo: tablo = Target.Value
Else
Sheets("Feuil2").[a1] = Target.Value
End If
End If
End Sub |
Partager