开发者

Using Or and + Criteria in VBA WorksheetFunction.Sumifs

Hi

I was wondering if there was a way I could conbine these 2 Macros as I want it to Sum Invoice_list_Price if it has either or both "(Custom) CREDIT" or "CREDIT" Criteria,

Thank You.

Range("DebtorList_Credit") = Application.SumIfs( _ 
  Range("Invoice_list_Price"), _
  Range("Invoice_list_Debtor"), _
开发者_Python百科  Range("Debtor_list_Debtors"), _
  Range("InvoiceList_Payed"), _
  "CREDIT")

Range("DebtorList_Credit") = Application.SumIfs( _
  Range("Invoice_list_Price"), _
  Range("Invoice_list_Debtor"), _
  Range("Debtor_list_Debtors"), _
  Range("InvoiceList_Payed"), _
  "(Custom) CREDIT")


Am I completely misunderstanding your question, or is this all you're after?

Range("DebtorList_Credit") = Application.SumIfs( _ 
  Range("Invoice_list_Price"), _
  Range("Invoice_list_Debtor"), _
  Range("Debtor_list_Debtors"), _
  Range("InvoiceList_Payed"), _
  "CREDIT")

Range("DebtorList_Credit") = Range("DebtorList_Credit") + '<--only change
  Application.SumIfs( _
  Range("Invoice_list_Price"), _
  Range("Invoice_list_Debtor"), _
  Range("Debtor_list_Debtors"), _
  Range("InvoiceList_Payed"), _
  "(Custom) CREDIT")


Range("DebtorList_Credit") = Application.SumIfs( _
Range("Invoice_list_Price"), _  
Range("Invoice_list_Debtor"), _  
Range("Debtor_list_Debtors"), _  
Range("InvoiceList_Payed"), _  
"*CREDIT*")`
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜