1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Sub stk()
Dim xlapp As New Excel.Application
Dim xlbook As New Excel.Workbook
Dim xlsheet As New Excel.Worksheet
Dim poids as single
Set xlbook = xlapp.Workbooks.Open("C:\Users\val\Desktop\bddstk.xlsx")
Set xlsheet = xlbook.Sheets("Feuil1")
xlsheet.Select
poids = WorksheetFunction.SumIfs(xlsheet.Range("k10:k100"), xlsheet.Range("d10:d100"), "52320", xlsheet.Range("f10:f100"), "4110000004")
xlbook.Close
xlapp.Quit
Set xlsheet = Nothing
Set xlbook = Nothing
Set xlapp = Nothing
End Sub |
Partager