+ Reply to Thread
Results 1 to 40 of 40

how can i test whether cell contains keyed constant or a formulae

  1. #1
    Forum Contributor
    Join Date
    06-21-2005
    Location
    Cambridge, England
    Posts
    118

    how can i test whether cell contains keyed constant or a formulae

    I would like to use conditional formatting to test whether a cell contains text or a formulae and higlight all cells as they are overtyped.

    I have tried using Type() but doesnt recognise difference between sam a number keyed in and a formulae beginning =if(. . . .

    Any ideas?

  2. #2
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    You have to write a userdefined function which can determine whether a cell has formula or not

    below is that funtion which determines whether a cell has formula or not, it takes the cell address as the parameter

    Function check_formula(r As Range)

    If Mid(r.Formula, 1, 1) = "=" Then
    check_formula = True
    Else
    check_formula = False
    End If
    End Function


    You have to paste the the above function in vba module.

    to use it in any cell type , =check_formula(b3) ' this will find whether cell b3 has formula or not , if formula is there it will return true, else false
    Last edited by anilsolipuram; 06-21-2005 at 07:03 PM.

  3. #3
    Forum Contributor
    Join Date
    06-21-2005
    Location
    Cambridge, England
    Posts
    118
    Thanks Anil - It worked and I learnt a bit more.

  4. #4
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  5. #5
    Forum Contributor
    Join Date
    06-21-2005
    Location
    Cambridge, England
    Posts
    118
    Dave
    Will this differentiate between a keyed constant and a formula - the difficulty I have encountered is that the keyed constant is recognised as a formula and therefore result will be true for both ?

  6. #6
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  7. #7
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  8. #8
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  9. #9
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  10. #10
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  11. #11
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  12. #12
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  13. #13
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  14. #14
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  15. #15
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  16. #16
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  17. #17
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  18. #18
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  19. #19
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  20. #20
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  21. #21
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  22. #22
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  23. #23
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  24. #24
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  25. #25
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  26. #26
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  27. #27
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  28. #28
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  29. #29
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  30. #30
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  31. #31
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  32. #32
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  33. #33
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  34. #34
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  35. #35
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  36. #36
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  37. #37
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  38. #38
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    I bet you meant something more like:

    Function check_formula(r As Range)
    If r.hasFormula Then
    check_formula = true
    Else
    check_formula = false
    End If

    End Function

    anilsolipuram wrote:
    >
    > You have to write a userdefined function which can determine whether a
    > cell has formula or not
    >
    > below is that funtion which determines whether a cell has formula or
    > not, it takes the cell address as the parameter
    >
    > Function check_formula(r As Range)
    > If r.Formula = "" Then
    > check_formula = False
    > Else
    > check_formula = True
    > End If
    >
    > End Function
    >
    > You have to paste the the above function in vba module.
    >
    > to use it in any cell type , =check_formula(b3) ' this will find
    > whether cell b3 has formula or not , if formula is there it will return
    > true, else false
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

  39. #39
    kk
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    Try http://www.j-walk.com/ss/excel/usertips/tip045.htm . It works for me.


    "Ruthki" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would like to use conditional formatting to test whether a cell
    > contains text or a formulae and higlight all cells as they are
    > overtyped.
    >
    > I have tried using Type() but doesnt recognise difference between sam a
    > number keyed in and a formulae beginning =if(. . . .
    >
    > Any ideas?
    >
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile:
    > http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978
    >




  40. #40
    Dave Peterson
    Guest

    Re: how can i test whether cell contains keyed constant or a formulae

    r.hasFormula

    will be true if the cell r has a formula. If it has text that starts with an
    equal sign (but still text), it will return false.



    Ruthki wrote:
    >
    > Dave
    > Will this differentiate between a keyed constant and a formula - the
    > difficulty I have encountered is that the keyed constant is recognised
    > as a formula and therefore result will be true for both ?
    >
    > --
    > Ruthki
    > ------------------------------------------------------------------------
    > Ruthki's Profile: http://www.excelforum.com/member.php...o&userid=24503
    > View this thread: http://www.excelforum.com/showthread...hreadid=380978


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1