Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub btnRevenusMois()
- Dim i As Integer: i = 4
- Dim dernierMois As Integer: dernierMois = Format(DateAdd("m", -1, Date), "mm")
- Dim sTot As Double
- Dim tps As Double
- Dim tvq As Double
- Dim total As Double
- While Not IsEmpty(Cells(i, 1))
- If Month(Cells(i, 1)) = dernierMois Then
- sTot = sTot + Cells(i, 4)
- tps = tps + Cells(i, 5)
- tvq = tvq + Cells(i, 6)
- total = total + Cells(i, 7)
- Rows(i).EntireRow.Copy
- Worksheets("data").Select
- Worksheets("data").Range("A" + CStr(i)).Select
- Worksheets("data").Paste
- Worksheets("Ventes").Select
- Application.CutCopyMode = False
- End If
- i = i + 1
- Wend
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement