Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A member of this forum provided the following UDF to display a formula within
a cell: Function GetFormula(Cell As Range) As String GetFormula = Cell.Formula End Function I tried creating the following €ścustom€ť Validation rule for cell A1 (which happens to contain a formula): =LEFT(GetFormula(A1),1)="=" but it is not working correctly (I get a €śNamed range cannot be found€ť error message). I want to ensure that someone doesn't inadvertently over-write a cell containing a formula. Can anyone show me how to do this using a Validation rule? I am aware of a solution using Conditional Formatting, but I really need to use a Validation rule. Any help would be greatly appreciated. Thanks, Bob |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you only enter =LEFT(GetFormula(a1),1) the it gives you "=" so the
function works. What were you looking for as a result of your formula. True? "Bob" wrote: A member of this forum provided the following UDF to display a formula within a cell: Function GetFormula(Cell As Range) As String GetFormula = Cell.Formula End Function I tried creating the following €ścustom€ť Validation rule for cell A1 (which happens to contain a formula): =LEFT(GetFormula(A1),1)="=" but it is not working correctly (I get a €śNamed range cannot be found€ť error message). I want to ensure that someone doesn't inadvertently over-write a cell containing a formula. Can anyone show me how to do this using a Validation rule? I am aware of a solution using Conditional Formatting, but I really need to use a Validation rule. Any help would be greatly appreciated. Thanks, Bob |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry Bob, I did not read your entire message before replying. There are a
couple of options to reduce the probability of overwriting cells with formulas. One is to portect the sheet and unlock only the cells that are allowed to have data entered. You can consult the help files for this method. The other simpler but less secure method is to add background colors to those cells that contain formulas. You can do that through the FormatCellsPatterns facility. "Bob" wrote: A member of this forum provided the following UDF to display a formula within a cell: Function GetFormula(Cell As Range) As String GetFormula = Cell.Formula End Function I tried creating the following €ścustom€ť Validation rule for cell A1 (which happens to contain a formula): =LEFT(GetFormula(A1),1)="=" but it is not working correctly (I get a €śNamed range cannot be found€ť error message). I want to ensure that someone doesn't inadvertently over-write a cell containing a formula. Can anyone show me how to do this using a Validation rule? I am aware of a solution using Conditional Formatting, but I really need to use a Validation rule. Any help would be greatly appreciated. Thanks, Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validation Rule | New Users to Excel | |||
Validation Rule anomaly | Excel Worksheet Functions | |||
Identifying formulas using a Validation rule | Excel Worksheet Functions | |||
Validation rule | Excel Discussion (Misc queries) | |||
validation rule | Excel Worksheet Functions |