=IF(SUMIFS(S8_Jumlah,S8_Mutasi,"M",S8_KodeBrg,$AA4)=0,0,(ROUND(SUMPRODUCT(S8_Jumlah,S8_HargaSatuan,--(S8_Mutasi="M"),--(S8_KodeBrg=DataPerlengkapan!$AA4))/SUMIFS(S8_Jumlah,S8_Mutasi,"M",S8_KodeBrg,$AA4),0)))
VERSI MACRO NYA
Sheet9.Range("AH4").Formula = "=IF(SUMIFS(S8_Jumlah,S8_Mutasi,""M"",S8_KodeBrg,$AA4)=0,0,(ROUND(SUMPRODUCT(S8_Jumlah,S8_HargaSatuan,--(S8_Mutasi=""M""),--(S8_KodeBrg=DataPerlengkapan!$AA4))/SUMIFS(S8_Jumlah,S8_Mutasi,""M"",S8_KodeBrg,$AA4),0)))"
__
Sub sortDB()
Sheet3.Select
Range("A2:Z2").Select
Selection.AutoFilter
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Add Key:=Range("B2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Add Key:=Range("C2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Add Key:=Range("D2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("db").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Selection.AutoFilter
End Sub
Sheet3.Select
Range("A2:Z2").Select
Selection.AutoFilter
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Add Key:=Range("B2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Add Key:=Range("C2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("db").AutoFilter.Sort.SortFields. _
Add Key:=Range("D2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("db").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Selection.AutoFilter
End Sub
Langganan:
Postingan (Atom)