ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detect if a cell value is a formula (https://www.excelbanter.com/excel-programming/340835-detect-if-cell-value-formula.html)

Jens Lenge

Detect if a cell value is a formula
 
Hello world,

I would like to make a VBA macro detect if a certain cell contains a fixed
value or a formula.

My first idea is to compare the ".Value" and ".Formula" properties and
declare regard it as a formula if they are different. Is this a good
approach or do you suggest a better solution?

Jens


Niek Otten

Detect if a cell value is a formula
 
?[A1].HasFormula

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Jens Lenge" wrote in message
...
Hello world,

I would like to make a VBA macro detect if a certain cell contains a fixed
value or a formula.

My first idea is to compare the ".Value" and ".Formula" properties and
declare regard it as a formula if they are different. Is this a good
approach or do you suggest a better solution?

Jens




Jens Lenge

Detect if a cell value is a formula
 
?[A1].HasFormula

Thank you!


All times are GMT +1. The time now is 04:20 AM.

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