ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to identify cells containing formulas (https://www.excelbanter.com/excel-programming/272597-re-how-identify-cells-containing-formulas.html)

JS[_4_]

how to identify cells containing formulas
 

The following macro will do this for you - i can e-mail you this as an addin
is you want which will enable you to click on a toolbar button and use it in
any spreadsheet

Sub ShowFormulas()
Dim cell As Range
On Error Resume Next

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

For Each cell In Cells.SpecialCells(xlCellTypeConstants)
If IsNumeric(cell.Value) Then
cell.Interior.ColorIndex = 4
End If
Next cell

Application.Calculation = xlCalculationAutomatic

End Sub




Myrna Larson[_2_]

how to identify cells containing formulas
 
Hi, JS:

There's another argument for SpecialCells that allows you to specify just numbers (just as you
can in the Goto/Special dialog box). That eliminates the need for your IsNumeric check.

On Thu, 24 Jul 2003 21:04:04 +0000 (UTC), "JS" wrote:


The following macro will do this for you - i can e-mail you this as an addin
is you want which will enable you to click on a toolbar button and use it in
any spreadsheet

Sub ShowFormulas()
Dim cell As Range
On Error Resume Next

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

For Each cell In Cells.SpecialCells(xlCellTypeConstants)
If IsNumeric(cell.Value) Then
cell.Interior.ColorIndex = 4
End If
Next cell

Application.Calculation = xlCalculationAutomatic

End Sub





All times are GMT +1. The time now is 03:13 PM.

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