Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone please show me how to test whether the cell is a formula or a
constant in VBA? say in A1, if I entered a formula, '=D4*E1', msgbox will pop up and say it is formula, and if I entered a value '1000', it pops up and say it is a value. Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this structure...
If Range("A1").HasFormula Then MsgBox "A1 has a formula" ElseIf Range("A1").Value < "" Then MsgBox "A1 has a constant value in it" Else MsgBox "A1 is empty" End If -- Rick (MVP - Excel) "JH" wrote in message ... Can someone please show me how to test whether the cell is a formula or a constant in VBA? say in A1, if I entered a formula, '=D4*E1', msgbox will pop up and say it is formula, and if I entered a value '1000', it pops up and say it is a value. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula vs. Constant | Excel Discussion (Misc queries) | |||
Testing for formula or value (constant) | Excel Programming | |||
Testing the results of a formula for zero | Excel Discussion (Misc queries) | |||
Testing for existence of a formula | Excel Worksheet Functions | |||
Constant in Formula | Excel Programming |