Forum Discussion
Mtwining230
Nov 28, 2022Copper Contributor
VBA for Subtotal with conditionals
How do I write in VBA code to get the Subtotal of Column I of ONLY the fields that have a Basic Fin date (Column E) that is equal to or less than today? I have a loop through activity for the merged ...
mathetes
Nov 30, 2022Silver Contributor
You ask for a VBA code, but have you tried the SUMIF function? If not, here's a link describing it, how to use it.
(By the way, as a general rule, people involved in Excel a lot try to avoid using merged cells; they have a tendency to create havoc with data integrity. Merged cells can make a spreadsheet look nicer to the human eye, but there are downsides when it comes to actually using the data. You can (if it's important to you) achieve much the same result by using conditional formatting to "white-out" the text whenever the value above is the same...or whatever condition is being used as the basis for the merging)