I thought I had seen a function called ISFORMULA somewhere, but perhaps not. What's the best non-VBA way to detect if a cell contains a formula or not?
I thought I had seen a function called ISFORMULA somewhere, but perhaps not. What's the best non-VBA way to detect if a cell contains a formula or not?
You can't without VBA. A UDF would look like this ...
[vba]Option Explicit
Public Function IsFormula(celRef As Range) As Boolean
IsFormula = celRef.HasFormula
End Function[/vba]
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables
Hi Sid,
You could use Edit/GoTo/Special/Formula/OK and colour the selected cells for a quick visual check.
Regards
Malcolm
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Thanx, guys. I was hoping that somewhere there was a function I could use in a formula. I suppose I could use Zack's contribution and put it in my Personal.xls for general reference. Thanx, Zack.
And Sid, you did remember correctly ... http://www.vbaexpress.com/kb/getarticle.php?kb_id=324
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables
Oops ... I KNEW I had seen it somewhere.
May be you are looking for Macro 4.0 GET.FORMULAOriginally Posted by Cyberdude
Suppose A1 = Sin(45)
C1= IsFormulaThere --> shows "= Sin(45)"
- Insert - Name - Define
- Names in Workbooks: IsFormulaThere
- Refer to: =GET.FORMULA(!$A$1)
Originally Posted by Emily
Excel4 macros are notoriously unstable, copying and pasting the formula to another worksheet is know to cause Excel to crash. This is one situation where I would reverse my maxim of using Excel functioanlity where possible. the VBA solution is just so much safer.