Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() How can I programs cells such that in case a hard input is used in a formula the cell turns red (using conditional formatting). Hard input in a formula is: "+" and any digit "-" and any digit "*" and any digit "/" and any digit Regards, Frederik -- Frederik12 ------------------------------------------------------------------------ Frederik12's Profile: http://www.excelforum.com/member.php...o&userid=32229 View this thread: http://www.excelforum.com/showthread...hreadid=519791 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can define a function to return true if it contains one of those
characters, then use conditional formatting in that range to turn cells red and reference the function, like =SpecChar(A1) where A1 is the active cell when you use the conditional formatting, and SpecChar is defined as: Public Function SpecChar(rg) As Boolean For Each thing In rg If InStr(thing.Formula, "+") 0 Or _ InStr(thing.Formula, "-") 0 Or _ InStr(thing.Formula, "/") 0 Or _ InStr(thing.Formula, "*") 0 Then SpecChar = True Exit Function End If Next End Function "Frederik12" wrote in message ... How can I programs cells such that in case a hard input is used in a formula the cell turns red (using conditional formatting). Hard input in a formula is: "+" and any digit "-" and any digit "*" and any digit "/" and any digit Regards, Frederik -- Frederik12 ------------------------------------------------------------------------ Frederik12's Profile: http://www.excelforum.com/member.php...o&userid=32229 View this thread: http://www.excelforum.com/showthread...hreadid=519791 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Bob Umlas Wrote: You can define a function to return true if it contains one of those characters, then use conditional formatting in that range to turn cells red and reference the function, like =SpecChar(A1) where A1 is the active cell when you use the conditional formatting, and SpecChar is defined as: Public Function SpecChar(rg) As Boolean For Each thing In rg If InStr(thing.Formula, "+") 0 Or _ InStr(thing.Formula, "-") 0 Or _ InStr(thing.Formula, "/") 0 Or _ InStr(thing.Formula, "*") 0 Then SpecChar = True Exit Function End If Next End Function Bob, thanks, but how do I define a function? KR -- Frederik12 ------------------------------------------------------------------------ Frederik12's Profile: http://www.excelforum.com/member.php...o&userid=32229 View this thread: http://www.excelforum.com/showthread...hreadid=519791 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Alternatively, you can use the following formula in CF (with the
FormulaIs option) =AND(OR(LEFT(A1,1)={"+","-","*","/"}),LEN(A1)=2,ISNUMBER(VALUE(MID(A1,2,1)))) HTH Kostis Vezerides |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hard returns in a formula? | Excel Worksheet Functions | |||
How to put hard returns in a cell without going to the next cell | Excel Discussion (Misc queries) | |||
how to remove hard returns, which show as little boxes | Excel Discussion (Misc queries) | |||
Automatic backup in excel with copy to hard drive and to cd-rw | Excel Discussion (Misc queries) | |||
re Macro - too hard for me !! | Excel Discussion (Misc queries) |