Nov 23 2021 04:54 PM
I want to be able to format subtotals in bold text. There are about 1000 of them in my sheet, so not practical to do it by hand and I can't format the whole column because the subtotals are in the same column as the data that generates them.
One way to pick out the subtotals would be by the contents of the adjacent cell, so I'm thinking of something like this:
If (A4 IsNull, then A5 format = Bold)
But I don't know how to that.
Nov 23 2021 09:19 PM
@MaxCA1000 If the sub-total rows have a common header like "Sub-total", you could put a filter on the sheet and select all sub-total rows, format them to your liking and then deselect the filter. Alternatively, if the sub-total rows contain formulae (like SUM, I presume) and the other rows are just "flat" numbers, select the entire range containing sub-totals, press F5, Special..., Select Formulas, OK and then Ctrl-B.
If this doesn't work, you can perhaps upload a file demonstrating exactly how your sheet is constructed. Remove anything confidential, though.
Nov 23 2021 10:02 PM
Nov 23 2021 10:30 PM - edited Nov 23 2021 10:34 PM
@MaxCA1000 Personally, I'm not a big fan of VBA. Especially not for something as trivial as formatting cells based on its content/nature. And now that I thought about it a bit more, why not use Conditional Formatting to highlight the cells with a formula in a particular range. See attached for an example, where I used a rule =ISFORMULA(D2), applied to column $D$2:$D$10. Perhaps that will work for you.
Edit: Sorry! Wrong file. New one attached.
Nov 25 2021 11:10 AM
Nov 25 2021 11:40 AM
@MaxCA1000 Glad you found a solution to your issue. Personally, I'm not very keen on using VBA. I guess Conditional Formatting could have achieved the same. Didn't think of that earlier. Sorry.
See attached.