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

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.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Value or formula?

See your other post.

"Eric" wrote:

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.misc
external usenet poster
 
Posts: 11,058
Default Value or formula?

How about a tiny UDF:

Function got_formula(r As Range) As Integer
If r.HasFormula Then
got_formula = 1
Else
got_formula = 0
End If
End Function


if you are not familiar with VBA, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary's Student
gsnu200701


"Eric" wrote:

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.misc
external usenet poster
 
Posts: 1,670
Default Value or formula?

Thank everyone for suggestion

I still don't understand how to create a User Defined Functions after
reading the link, it shows only the macro, but it does not talk much about
User Defined Functions. Could you please give me more suggestion?
Thank for your help
Eric

"Gary''s Student" wrote:

How about a tiny UDF:

Function got_formula(r As Range) As Integer
If r.HasFormula Then
got_formula = 1
Else
got_formula = 0
End If
End Function


if you are not familiar with VBA, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary's Student
gsnu200701


"Eric" wrote:

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 06:05 PM.

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

About Us

"It's about Microsoft Excel"