Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,670
Default Value or formula?

Refering to General Question

Does anyone know how to differentiate the cell formed by a value or a formula?
such as in cell a1 = 7 [value only] and in cell b1 = 3 + 4 [any formula]
If the cell contains value, then return 0, else
If the cell contains formula, then reurn 1.
In this case, a2 = 0 [return], because a1 contains value and
b2 = 1 [return], because b1 contains formula
Does anyone have any suggestion?
Thank you in advance
Eric
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Value or formula?

You could use a custom function:

Function IsFormula(rng As Range) As Boolean
IsFormula = rng.HasFormula
End Function


syntax is
=Isformula(A1)

or
=--Isformula(A1)
to get a 1 or 0.

For more on macros and UDF's.
http://www.mvps.org/dmcritchie/excel/getstarted.htm


"Eric" wrote:

Refering to General Question

Does anyone know how to differentiate the cell formed by a value or a formula?
such as in cell a1 = 7 [value only] and in cell b1 = 3 + 4 [any formula]
If the cell contains value, then return 0, else
If the cell contains formula, then reurn 1.
In this case, a2 = 0 [return], because a1 contains value and
b2 = 1 [return], because b1 contains formula
Does anyone have any suggestion?
Thank you in advance
Eric

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,670
Default Value or formula?

Thank you for your reply
I find no IsFormula function under my excel, could you please tell me how to
add this function?
Thank you very much
Eric

"JMB" wrote:

You could use a custom function:

Function IsFormula(rng As Range) As Boolean
IsFormula = rng.HasFormula
End Function


syntax is
=Isformula(A1)

or
=--Isformula(A1)
to get a 1 or 0.

For more on macros and UDF's.
http://www.mvps.org/dmcritchie/excel/getstarted.htm


"Eric" wrote:

Refering to General Question

Does anyone know how to differentiate the cell formed by a value or a formula?
such as in cell a1 = 7 [value only] and in cell b1 = 3 + 4 [any formula]
If the cell contains value, then return 0, else
If the cell contains formula, then reurn 1.
In this case, a2 = 0 [return], because a1 contains value and
b2 = 1 [return], because b1 contains formula
Does anyone have any suggestion?
Thank you in advance
Eric

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Value or formula?

It is a user-defined function (UDF). You will need to copy the code into a
Visual Basic module.

Follow the link for instructions. You will want to pay particular attention
to "Using someone else's macro (#havemacro)" which covers installing a macro
from a newsgroup.




"Eric" wrote:

Thank you for your reply
I find no IsFormula function under my excel, could you please tell me how to
add this function?
Thank you very much
Eric

"JMB" wrote:

You could use a custom function:

Function IsFormula(rng As Range) As Boolean
IsFormula = rng.HasFormula
End Function


syntax is
=Isformula(A1)

or
=--Isformula(A1)
to get a 1 or 0.

For more on macros and UDF's.
http://www.mvps.org/dmcritchie/excel/getstarted.htm


"Eric" wrote:

Refering to General Question

Does anyone know how to differentiate the cell formed by a value or a formula?
such as in cell a1 = 7 [value only] and in cell b1 = 3 + 4 [any formula]
If the cell contains value, then return 0, else
If the cell contains formula, then reurn 1.
In this case, a2 = 0 [return], because a1 contains value and
b2 = 1 [return], because b1 contains formula
Does anyone have any suggestion?
Thank you in advance
Eric

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM


All times are GMT +1. The time now is 05:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"