ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to tell whether a cell contains a formula? (https://www.excelbanter.com/excel-programming/271701-re-how-tell-whether-cell-contains-formula.html)

Tom Ogilvy

How to tell whether a cell contains a formula?
 
I belive that is

if range("A12").hasformula then

but that would be true for

=pi()*2000

which doesn't refer to a another cell (but maybe he didn't mean to exclude
those).

Regards,
Tom Ogilvy


"Don Guillett" wrote in message
...
if isformula([a12])

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Seihee" wrote in message
...
Hi!

I'm writing a macro to examine all cells in a worksheet.
If a cell contains a "pure formula" referencing other
cells, then I want to change the color of the cell that
contains a formula.

In a macro, is there any way I can tell whether a cell
contains a formula rather than pure values (number,
literal, etc.)?

By "pure formula", I mean a formula that contain a cell
reference. In other words, "=b5+k2" will be considered a
formula but "=5+28/4" will not for my purposes.

Your help will be greatly appreciated.

Thanks,
Seihee






Don Guillett[_4_]

How to tell whether a cell contains a formula?
 
Oops.

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Tom Ogilvy" wrote in message
...
I belive that is

if range("A12").hasformula then

but that would be true for

=pi()*2000

which doesn't refer to a another cell (but maybe he didn't mean to exclude
those).

Regards,
Tom Ogilvy


"Don Guillett" wrote in message
...
if isformula([a12])

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Seihee" wrote in message
...
Hi!

I'm writing a macro to examine all cells in a worksheet.
If a cell contains a "pure formula" referencing other
cells, then I want to change the color of the cell that
contains a formula.

In a macro, is there any way I can tell whether a cell
contains a formula rather than pure values (number,
literal, etc.)?

By "pure formula", I mean a formula that contain a cell
reference. In other words, "=b5+k2" will be considered a
formula but "=5+28/4" will not for my purposes.

Your help will be greatly appreciated.

Thanks,
Seihee









All times are GMT +1. The time now is 10:27 AM.

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