Forum Discussion
Hannah365
Feb 10, 2022Copper Contributor
Macro for adding columns with variable rows
Hi! I am trying to create a macro that will subtotal columns I and L where column B contains the word "summary". is this possible?!?!?
Hannah365
Feb 10, 2022Copper Contributor
Hmmm it did not work for some reason.
Hannah365
Feb 10, 2022Copper Contributor
Assuming i enter this formula in the conditional formatting ?
- HansVogelaarFeb 10, 2022MVP
You mentioned subtotal in the first post, not conditional formatting!
Select columns I and L.
I will assume that the active cell in the selection is in row 1.
On the Home tab of the ribbon, select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=$B1="summary"
Click Format...
Activate the Fill tab.
Select a color.
Click OK, then click OK again.
- Hannah365Feb 10, 2022Copper ContributorI think i got them a bit confused. i do want a subtotal but i want it to do it on the entire sheet when i run my macro. do i just copy and paste the formula you originally sent into my macro that has my other conditional formatting already?
- HansVogelaarFeb 10, 2022MVP
I'm confused now. Let's start from scratch: could you try to explain as clearly as you can what you want?