Forum Discussion
goncalogera
Nov 13, 2020Copper Contributor
Create a custom SUM(IF) function with VBA
Hi there, I have a table called ("Vendas2020") that has the daily sales and each row has either "C" or "V" if they're either a purchase or a sale (C/V column is the fifth one and is called "Compra...
- Nov 13, 2020
If I understand what you're trying to do (conditional subtotal), then I don't think you don't need vba.
I attached an example file - if you filter column 1 for either "A" or "B", then the formula below the table will subtotal the visible cells where Compra/Venda=C.
NikolinoDE
Nov 13, 2020Gold Contributor
1. VBA SUMIF based on Variables
2. WorksheetFunction.SumIf method (Excel)
https://docs.microsoft.com/en-us/office/vba/api/excel.worksheetfunction.sumif
Hope I was able to help you.
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here
- goncalogeraNov 13, 2020Copper Contributor
NikolinoDE Thank you very much for your answer but I'm trying to create my own custom SUBTOTAL function