DushiPunda
Well-known Member
- Joined
- Nov 14, 2015
- Messages
- 518
- Office Version
- 2021
- Platform
- Windows
Hello,
I have an event log at work and every other row is highlighted gray via conditional formatting using this:
So, as the title says, I want manual formatting to override my conditional formatting. That is, if I want to highlight one of the rows that is already highlighted gray with a different color, then that color should show and not the gray.
I've found a way to do this, though I can't exactly remember where. Here's how it's set up:
I then have another conditional formatting rule. This rule is the top rule, "Stop If True" is checked, and formatting is set to none. The rule formula:
This all works fine and dandy, but there are some quirks to it. Here's an example:
1. If I select on of the rows and and change the fill to, say, yellow.
2. Upon hovering over the color I want to select (obviously this only applies if I use the drop down to select the color and do not just click the button to use the currently selected color), my selection turns that color.
3. Upon clicking on the color, the row will be displayed as gray.
4. After that, if I enter edit mode on any cell (double click), and then exit edit mode by selecting another cell or tabbing out, the row I changed will update to the color I selected. (This is quirky; while testing this, I noticed that one time I did this with a cell that was not within my selection and the fill did not update. I've tested this numerous times since then and it's worked every time)
It is probably worth noting:
1. Resetting the original selection back to no fill immediately updates it to the expected gray fill.
2. Sometimes, usually the first time I try to change the fill on one of the gray lines, it will change to the new color immediately. Subsequent changes to other rows fall in line with my example above.
I've tried changing the fill color by all of the following methods, and they all behave the same way:
1. Selecting the drop down arrow next to the Fill Color button on the Home Ribbon, then selecting the color.
2. Clicking the Fill Color button directly on the Home Ribbon (if it is set to something other than "No Fill").
3. Right clicking on my selection and doing the same thing as #1/#2 using the Fill Color button on the small formatting box that appears above the right click window.
4. Right clicking on my selection and choosing Format Cells and selecting the color on the Fill tab and then hitting OK.
After some research, I've discovered that it's not possible to trigger events (i.e. Worksheet_Change) when the formatting of a cell (or cells) is changed. I tried a couple things with the Worksheet_SelectionChange event, but to no avail. Here's what I tried:
1. ActiveSheet.Calculate
2. Application.ScreenUpdating toggle (Application.ScreenUpdating = False (next line) Application.ScreenUpdating = True)
Again, neither of these worked. I'm looking for possible solutions to get this to act as expected, i.e.:
1. Select fill color
2. Correct fill color displays without any of the quirkiness noted above.
Thanks!
I have an event log at work and every other row is highlighted gray via conditional formatting using this:
Code:
=MOD(ROW(),2)=1
So, as the title says, I want manual formatting to override my conditional formatting. That is, if I want to highlight one of the rows that is already highlighted gray with a different color, then that color should show and not the gray.
I've found a way to do this, though I can't exactly remember where. Here's how it's set up:
Code:
Public Function TestColor(MyRange as Range) As Boolean[INDENT]If Range(MyRange.Address).Interior.Pattern = xlNone Then TestColor = True[/INDENT]
End Function
I then have another conditional formatting rule. This rule is the top rule, "Stop If True" is checked, and formatting is set to none. The rule formula:
Code:
=NOT(TestColor(A3))
This all works fine and dandy, but there are some quirks to it. Here's an example:
1. If I select on of the rows and and change the fill to, say, yellow.
2. Upon hovering over the color I want to select (obviously this only applies if I use the drop down to select the color and do not just click the button to use the currently selected color), my selection turns that color.
3. Upon clicking on the color, the row will be displayed as gray.
4. After that, if I enter edit mode on any cell (double click), and then exit edit mode by selecting another cell or tabbing out, the row I changed will update to the color I selected. (This is quirky; while testing this, I noticed that one time I did this with a cell that was not within my selection and the fill did not update. I've tested this numerous times since then and it's worked every time)
It is probably worth noting:
1. Resetting the original selection back to no fill immediately updates it to the expected gray fill.
2. Sometimes, usually the first time I try to change the fill on one of the gray lines, it will change to the new color immediately. Subsequent changes to other rows fall in line with my example above.
I've tried changing the fill color by all of the following methods, and they all behave the same way:
1. Selecting the drop down arrow next to the Fill Color button on the Home Ribbon, then selecting the color.
2. Clicking the Fill Color button directly on the Home Ribbon (if it is set to something other than "No Fill").
3. Right clicking on my selection and doing the same thing as #1/#2 using the Fill Color button on the small formatting box that appears above the right click window.
4. Right clicking on my selection and choosing Format Cells and selecting the color on the Fill tab and then hitting OK.
After some research, I've discovered that it's not possible to trigger events (i.e. Worksheet_Change) when the formatting of a cell (or cells) is changed. I tried a couple things with the Worksheet_SelectionChange event, but to no avail. Here's what I tried:
1. ActiveSheet.Calculate
2. Application.ScreenUpdating toggle (Application.ScreenUpdating = False (next line) Application.ScreenUpdating = True)
Again, neither of these worked. I'm looking for possible solutions to get this to act as expected, i.e.:
1. Select fill color
2. Correct fill color displays without any of the quirkiness noted above.
Thanks!