Forum Discussion
Format an entire row.
- Apr 26, 2021
Hi mate, thanks for your reply but does not seem to work. If one of my share holdings gets sold I would like to have that particular row change colour so that it is easier to keep track of which shares I am still holding. Will try and attach the file. You can see where I have coloured the rows manually, i would like this to happen for every sold share if possible.
You haven't specified any details, so I'll provide a random example. Let's say you want to highlight a row if the Sell Date is more than 30 days after the Purchase Date.
Select the entire range from row 2 down to the last used row.
I will assume that the active cell in the selection is in row 2.
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
=$N2-$A2>30
The $ signs before the column letters are essential here - the "fix" the columns.
Click Format...
Actvate the Fill tab.
Select a color.
Click OK, then click OK again.
Hi mate, thanks for your reply but does not seem to work. If one of my share holdings gets sold I would like to have that particular row change colour so that it is easier to keep track of which shares I am still holding. Will try and attach the file. You can see where I have coloured the rows manually, i would like this to happen for every sold share if possible.
- HansVogelaarApr 26, 2021MVP
So a row should be highlighted if column N has a date?
You'd use the formulka =$N2<>"" in the conditional formatting rule.
See the attached version.
- Rick64Apr 26, 2021Copper Contributor
Thanks Hans, much appreciated.