=ISFORMULA(A1) ?
MZ Tools makes life easier for the Excel VBA coder
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: =ISFORMULA(A1) ?

  1. #1
    Board Regular eliW's Avatar
    Join Date
    Mar 2002
    Posts
    1,919
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Is there in Excel any function to check if a cell contains a formula, like for example =ISNUMBER(A1) or ISTEXT(A1)?
    Eli

    [ This Message was edited by: eliW on 2002-04-08 14:35 ]

  2. #2
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    81,809
    Post Thanks / Like
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)

    Default

    On 2002-04-08 14:29, eliW wrote:
    Is there in Excel any function to check if a cell contains a formula, like for example =ISNUMBER(A1) or ISTEXT(A1)?
    Eli
    No. It's not too difficult though to set up a UDF. I might add that such a built-in function would be a totally different beast among the IS-functions which all directed at values in a cell, not at the underlying generator of values.

    Aladin

  3. #3
    Board Regular eliW's Avatar
    Join Date
    Mar 2002
    Posts
    1,919
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thank you Aladin,
    It would be very useful though.

  4. #4
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    Could not get the Excel TYPE(Value) function to test True for 8 (the formula), but here is an UDF that works.

    -----------------------
    Function IsFormula(RefCell As Range)
    If RefCell.Cells.Count <> 1 Then
    IsFormula = CVErr(xlErrValue)
    Else
    IsFormula = RefCell.HasFormula
    End If
    End Function
    -----------------------

    Returns True or False. Called as
    =ISFORMULA(A1)

    Should work with other functions.

    HTH,
    Jay

  5. #5
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    On 2002-04-08 14:29, eliW wrote:
    Is there in Excel any function to check if a cell contains a formula, like for example =ISNUMBER(A1) or ISTEXT(A1)?
    Eli

    [ This Message was edited by: eliW on 2002-04-08 14:35 ]
    You could cheat!!

    1. Enter =A2+2 into cell A1.
    2. With cell B1 selected setup a defined name, Has_Formula, that refers to...

    =GET.CELL(48,A1)

    Now, you can enter the formula, =Has_Formula, in any cell to see if the cell to its left contains a formula. =Has_Formula will return TRUE or FALSE.

    [ This Message was edited by: Mark W. on 2002-04-08 16:19 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com