Salut DUPLAIN,
Salut Steelson, m3ellem1
je lis des mentions à Mac...
J'espère que ceci ira...
Un double-clic sur la feuille 'BDD' affiche ta mise en forme souhaitée en 'Extract'.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim tData, lgNum&, iRow%
'
Cancel = True
On Error Resume Next
Application.ScreenUpdating = False
'
tData = Range("C1:G1").Value
Range("A1:G" & Range("A" & Rows.Count).End(xlUp).Row).Sort _
key1:=Range("B2"), order1:=xlAscending, key2:=Range("A2"), order2:=xlAscending, Orientation:=xlTopToBottom, Header:=xlYes
With Worksheets("Extract")
.Cells.Delete
For x = 2 To Range("B" & Rows.Count).End(xlUp).Row
If CLng(Range("B" & x).Value) <> lgNum Then
lgNum = CLng(Range("B" & x).Value)
iRow = .Range("B" & Rows.Count).End(xlUp).Row + 2
.Range("A" & iRow).Value = lgNum
.Range("B" & iRow).Resize(5, 1).Value = WorksheetFunction.Transpose(tData)
.Range("B" & iRow).Resize(5, 13).Borders.LineStyle = xlContinuous
End If
iMonth = Month(CDate(Range("A" & x).Value))
For y = 3 To 7
If CInt(Cells(x, y)) > 0 Then .Cells(iRow + (y - 3), 2 + iMonth) = .Cells(iRow + (y - 3), 2 + iMonth) + Cells(x, y)
Next
Next
.Activate
.Columns("A:B").AutoFit
.Range("C:N").HorizontalAlignment = xlHAlignCenter
.Range("C1:N1").HorizontalAlignment = xlCenterAcrossSelection
.Range("C1").Value = Year(CDate(Range("A2").Value)) & " - Totaux d'entrées par mois"
.Range("C1").Font.Bold = True
.Range("C1").Font.Size = 16
.Range("C2").Resize(1, 12).Value = Array("Janv.", "Fév.", "Mars", "Avr.", "Mai", "Juin", "Juil.", "Août", "Sept.", "Oct.", "Nov.", "Déc.")
.Range("C1").Resize(1, 12).Interior.ColorIndex = 45
.Range("C2").Resize(1, 12).Interior.ColorIndex = 15
.Range("C1:N2").Borders.LineStyle = xlContinuous
.Range("C1:N2").BorderAround Weight:=xlMedium
ActiveWindow.FreezePanes = False
.Range("A3").Select
ActiveWindow.FreezePanes = True
End With
'
Application.ScreenUpdating = True
On Error GoTo 0
'
End Sub
A+