ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Apply conditional formatting to non-blank cells (https://www.excelbanter.com/excel-programming/371940-apply-conditional-formatting-non-blank-cells.html)

Snowsride

Apply conditional formatting to non-blank cells
 
I have a spreadsheet that is refreshed periodically and the data range
changes each time. I want to apply conditional formatting to non-blank cells
in columns D, F and H. So I guess I need to identify the number of rows in
the range and then loop through each cell in each of columns D, F and H and
apply the formatting.

How can I do this?

Grateful for any help.

Andy Wiggins

Apply conditional formatting to non-blank cells
 
Why not apply conditional formatting to the whole lot?

For example:
Format Conditional Formatting : 'Formual Is'
... then in the formula box put
=NOT(ISBLANK(A1))
... and set a colour.

This will highlight the non-blank cells.

Similarly:
=ISBLANK(A1)

... can be used to highlight blank cells.

More info:
http://www.bygsoftware.com/Excel/Int...formatting.htm

--
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
-

"Snowsride" wrote in message
...
I have a spreadsheet that is refreshed periodically and the data range
changes each time. I want to apply conditional formatting to non-blank
cells
in columns D, F and H. So I guess I need to identify the number of rows
in
the range and then loop through each cell in each of columns D, F and H
and
apply the formatting.

How can I do this?

Grateful for any help.




Snowsride

Apply conditional formatting to non-blank cells
 
Andy

Thanks - found a solution. There are 3 condional formats and a default thus
allowing 4 colours but if a cell is blank it has to be unformatted. Solution
involved a For..Next loop and some if statements.

Thanks

"Andy Wiggins" wrote:

Why not apply conditional formatting to the whole lot?

For example:
Format Conditional Formatting : 'Formual Is'
... then in the formula box put
=NOT(ISBLANK(A1))
... and set a colour.

This will highlight the non-blank cells.

Similarly:
=ISBLANK(A1)

... can be used to highlight blank cells.

More info:
http://www.bygsoftware.com/Excel/Int...formatting.htm

--
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
-

"Snowsride" wrote in message
...
I have a spreadsheet that is refreshed periodically and the data range
changes each time. I want to apply conditional formatting to non-blank
cells
in columns D, F and H. So I guess I need to identify the number of rows
in
the range and then loop through each cell in each of columns D, F and H
and
apply the formatting.

How can I do this?

Grateful for any help.






All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com