Private Sub Worksheet_Change(ByVal Target As Range)
Dim Site As Range
Dim y As Integer
Dim x As Integer
Set Site = Range("B6:B65536")
y = (Target.Row - 4) * 4
If Not Application.Intersect(Site, Range(Target.Address)) _
Is Nothing Then
'retranscritpion des données sites de la feuille "sites B" vers la feuille "consommation"
Sheets("Consommation").Range(Sheets("Consommation").Cells(y, 1), Sheets("Consommation").Cells(y + 3, 1)).Merge
Sheets("Consommation").Cells(y, 1).Value = Cells(Target.Row, Target.Column).Value
'Mise en page Conso Base et Conso HC ainsi que le Total Conso pour le site concerné
Sheets("Consommation").Cells(y, 2).Value = "Conso Base"
Sheets("Consommation").Cells(y + 1, 2).Value = "Conso HP"
Sheets("Consommation").Cells(y + 2, 2).Value = "Conso HC"
Sheets("Consommation").Cells(y + 3, 2).Value = "Total Conso"
For x = y To y + 3
Sheets("Consommation Sites Bleu").Cells(x, 3).Value = " kWh "
Next
End If
End Sub