ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional formatting based on what function is used in a cell. (https://www.excelbanter.com/excel-programming/397460-conditional-formatting-based-what-function-used-cell.html)

hugehead

Conditional formatting based on what function is used in a cell.
 
Is there a way to use conditional formatting in such a way so I can highlight
cells that use a particular formula?
For example, my spreadsheet uses a lot of INDIRECT() formulas in different
variations, but I would like to highlight them all.
Thanks in advance.

Bob Phillips

Conditional formatting based on what function is used in a cell.
 
VBA would do it

Public Sub Test()
Dim cell As Range
For Each cell In ActiveSheet.UsedRange
If cell.HasFormula Then
If InStr(cell.Formula, "INDIRECT") 0 Then
cell.Interior.ColorIndex = 38
End If
End If
Next cell
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"hugehead" wrote in message
...
Is there a way to use conditional formatting in such a way so I can
highlight
cells that use a particular formula?
For example, my spreadsheet uses a lot of INDIRECT() formulas in different
variations, but I would like to highlight them all.
Thanks in advance.





All times are GMT +1. The time now is 09:43 AM.

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