开发者

Using Or and + Criteria in VBA WorksheetFunction.Sumifs

开发者 https://www.devze.com 2023-01-22 11:53 出处:网络
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,

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

精彩评论

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