Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [C2]) Is Nothing Then Exit Sub
Dim i As Variant
[H9:N9,H14:N14,H19:N19,H24:N24:H29:J29] = "" 'RAZ
With Feuil3 'CodeName de la feuille Sauvegarde
i = Application.Match([C2], .[4:4], 0)
If IsNumeric(i) Then
[H9:N9] = Application.Transpose(.Cells(5, i + 1).Resize(7).Value)
[H14:N14] = Application.Transpose(.Cells(12, i + 1).Resize(7).Value)
[H19:N19] = Application.Transpose(.Cells(19, i + 1).Resize(7).Value)
[H24:N24] = Application.Transpose(.Cells(26, i + 1).Resize(7).Value)
[H29:J24] = Application.Transpose(.Cells(33, i + 1).Resize(3).Value)
End If
End With
End Sub
Private Sub CommandButton1_Click() 'bouton Transfert (ActiveX)
Dim i As Variant
With Feuil3 'CodeName de la feuille Sauvegarde
i = Application.Match([C2], .[4:4], 0)
If IsNumeric(i) Then
.Cells(5, i + 1).Resize(7) = Application.Transpose([H9:N9].Value)
.Cells(12, i + 1).Resize(7) = Application.Transpose([H14:N14].Value)
.Cells(19, i + 1).Resize(7) = Application.Transpose([H19:N19].Value)
.Cells(26, i + 1).Resize(7) = Application.Transpose([H24:N24].Value)
.Cells(33, i + 1).Resize(3) = Application.Transpose([H29:J24].Value)
Application.Goto .Cells(4, i) 'sélection facultative
End If
End With
End Sub