[Solved] No Conditional Formatting After Inserting Rows

Discuss the spreadsheet application
Post Reply
User avatar
brodiemac
Posts: 24
Joined: Tue Feb 24, 2009 4:05 pm

[Solved] No Conditional Formatting After Inserting Rows

Post by brodiemac »

I have a spreadsheet where we insert sales totals for sales people. These numbers are automatically imported from another worksheet in the workbook. I have a formula at the bottom of each column that functions as an error checking mechanism. It compares the total from the column to the total on another sheet. If the result is anything other than zero (no difference) the cell will highlight in red. I've setup the same conditional formatting for the column header to make it easier to spot when scrolling through the spreadsheet. It works just fine but where it goes wrong is when I insert a new row. The formatting in the cell with the formula continues to work but the column header formatting does not. If the initial setup for conditional formatting references cell D100, after inserting a row, it will still reference that cell and not automatically follow the cell with the formula in it. I know M$ Excel does this very well. How do I force the conditional formatting to continue referencing the cell with the formula in it after a row is inserted? :crazy:
Last edited by Hagar Delest on Sat Jan 16, 2010 5:08 pm, edited 1 time in total.
Reason: tagged [Solved].
Great minds discuss ideas;
Average minds discuss events;
Small minds discuss people.
-- Eleanor Roosevelt
OOo 3.3 on M$ Windows 7 SP1
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Conditional Formatting Stops Working After Inserting Rows

Post by Villeroy »

Conditional Formatting Stops Working After Inserting Rows
Works for me with inserted new rows. It works perfectly with imported data from a registered data source, including conditional formatting chart ranges, adjacent formula ranges and everything without a single line of stupid Basic code.
These numbers are automatically imported from another worksheet in the workbook.
Automatically? A macro? Simply let your macro insert new rows and then dump the source range's DataArray over the target range.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
brodiemac
Posts: 24
Joined: Tue Feb 24, 2009 4:05 pm

Re: Conditional Formatting Stops Working After Inserting Rows

Post by brodiemac »

Not a macro. It's a formula that scans the other worksheet by name and brings overs the associated sales figures.
Great minds discuss ideas;
Average minds discuss events;
Small minds discuss people.
-- Eleanor Roosevelt
OOo 3.3 on M$ Windows 7 SP1
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Conditional Formatting Stops Working After Inserting Rows

Post by Villeroy »

=Numeric_Formula+STYLE(IF(condition1;"styleA";IF(condition2;"styleB";"styleC")))

This could work more elegantly with a database connection (which can point to another spreadsheet behind the database).
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ken johnson
Volunteer
Posts: 918
Joined: Sun May 31, 2009 1:35 am
Location: Sydney, Australia

Re: Conditional Formatting Stops Working After Inserting Rows

Post by ken johnson »

Click in D100 then click in the Name Box on the left side of the Formula Bar.
Type in a suitable name for D100 eg Total, then press Enter.
Use the defined name Total in the conditional formatting in place of D100.
The cells pushed down by the row insert take their name with them.

Ken Johnson
AOO 4.1.3 on Ms Windows 10
Help improve this forum by clicking the EDIT button on your first post then adding "[Solved]" to its heading once a solution to your problem has been provided.
User avatar
brodiemac
Posts: 24
Joined: Tue Feb 24, 2009 4:05 pm

Re: Conditional Formatting Stops Working After Inserting Rows

Post by brodiemac »

ken johnson wrote:Click in D100 then click in the Name Box on the left side of the Formula Bar.
Type in a suitable name for D100 eg Total, then press Enter.
Use the defined name Total in the conditional formatting in place of D100.
The cells pushed down by the row insert take their name with them.

Ken Johnson
I tried this and it seems to work just fine. Thanks! :super:
Great minds discuss ideas;
Average minds discuss events;
Small minds discuss people.
-- Eleanor Roosevelt
OOo 3.3 on M$ Windows 7 SP1
Post Reply