Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Excel Ques?
Hi everyone,
Say I have in cell B2 a function like this: "=If(c2=5,1,0)" OR this "=1+34*x" and I want to check from cell F5 to see if what I have in B2 is like this: if(or(b2 = "=If",b2="=1"),.....) I don't want to put the whole function just the 1st part of it; if it has "=If" or "=1" How can I do so? Thanks, Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Excel Ques?
Add a UDF
Function IsFormula(rng as Range) If rng.Coount = 1 Then IsFormula = rng.HasFormula End If End SUb and use like =IF(Isformula(B2),....) -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Mike" wrote in message oups.com... Hi everyone, Say I have in cell B2 a function like this: "=If(c2=5,1,0)" OR this "=1+34*x" and I want to check from cell F5 to see if what I have in B2 is like this: if(or(b2 = "=If",b2="=1"),.....) I don't want to put the whole function just the 1st part of it; if it has "=If" or "=1" How can I do so? Thanks, Mike |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Excel Ques?
Directly though Excel (not using VBA) I am affraid you can not do what you
are attempting. You can only read the return value of the function in the cell, not the text of the function itself... Just wondering, how is it you will not know what function that you have in the cell? maybe there is some way to work around this... -- HTH... Jim Thomlinson "Mike" wrote: Hi everyone, Say I have in cell B2 a function like this: "=If(c2=5,1,0)" OR this "=1+34*x" and I want to check from cell F5 to see if what I have in B2 is like this: if(or(b2 = "=If",b2="=1"),.....) I don't want to put the whole function just the 1st part of it; if it has "=If" or "=1" How can I do so? Thanks, Mike |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Excel Ques?
Unless you want to write a user defined function in VBA, you can't check the
formula of another cell using built in worksheet formulas. Public Function checkformula(cell as Range) set Target = Cell(1) sForm = Target.Formula if Left(sForm,3) = "=IF" then checkformula = True else checkformula = false end if End Function placed in a general module then in the worksheet =Checkformula(B2) alter the code to do exactly what you want. -- Regards, Tom Ogilvy "Mike" wrote: Hi everyone, Say I have in cell B2 a function like this: "=If(c2=5,1,0)" OR this "=1+34*x" and I want to check from cell F5 to see if what I have in B2 is like this: if(or(b2 = "=If",b2="=1"),.....) I don't want to put the whole function just the 1st part of it; if it has "=If" or "=1" How can I do so? Thanks, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dat. Validaation - simple ques | Excel Worksheet Functions | |||
HOW: estb. simple/1 ques. survey? | Excel Discussion (Misc queries) | |||
ques | Excel Worksheet Functions | |||
thanks...But I had another ques | Excel Programming | |||
formatting ques... | Excel Programming |