Conditional formatting to identify hard-coded cells

simonalcock

New Member
Joined
Oct 19, 2007
Messages
2
Hi all,

I have a spreadsheet in which some cells have lost their formulas. The calculated value is still displayed, but it no longer updates with the rest of the sheet (as if F2, F9 had been pressed).

I need to find out which cells contain hard-coded numbers rather than formulas, and have been trying to use conditional formatting to highlight them for me.

I have a solution, but it seems to make the workbook terribly slow. If anyone has a simpler solution to this problem, I'd love to hear your ideas. My solution follows:

Define the following function in VBA:
Code:
Function IsFormula(cell As Range)
    IsFormula = cell.HasFormula()
End Function
Apply conditional formatting to the required range of cells, using the following formula to determine which cells to format:
Code:
=AND(NOT(OR(isformula(A1),ISBLANK(A1))),ISNUMBER(A1))
 
OK got an solution to my own problem:

Add this function in a Module:
Code:
Function IsFormula(cell_ref As Range)
    Application.Volatile
    IsFormula = cell_ref.HasFormula
End Function

and add this in cell N4:
Code:
=isformula(G4)
it checks G4, if formula is present, and returns TRUE or FALSE in N4
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You could also just change Jon's defined name to:
=GET.CELL(48,INDIRECT("RC[-1]",0))
 
Upvote 0

Forum statistics

Threads
1,215,944
Messages
6,127,835
Members
449,411
Latest member
adunn_23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top