Bonjour, j'ai besoin d'aide SVP. j'essaie de faire la somme de la colonne p et afficher le résultat dans la première cellules Q1. MERCI
Sub GetSum()
Dim firstraw As Double
Dim lastrow As Long
firstrow = WorksheetFunction.Sum(Range("q1"))
lastrowrow = ThisWorkbook.Sheets("Feuil1").Cells(Rows.Count, 17).End(xlUp).Row
ThisWorkbook.Sheets("Feuil1").Range("o" & lastrow + 1) = "Total:"
ThisWorkbook.Sheets("Feuil1").Range("p" & lastrow + 1) = Application.WorksheetFunction.Sum(ThisWorkbook.Sheets("Feuil1").Range("p2:p" & lastrow))
ThisWorkbook.Sheets("Feuil1").Range("q" & firstrow).Font.Bold = True
End Sub