XLM4.0 Has Formula in Validation

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,907
Office Version
  1. 365
Platform
  1. Windows
Hi All

I was trying to see if I could come up with a slick solution to this post.

Using names - e.g. Has_Formula refers to:
=GET.CELL(48,INDIRECT(ROW(),COLUMN(),4))

This should return TRUE if the cell houses a formula, FALSE if it does not.

Now, I have attempted to apply this within validation to stop a user from entering a constant into a cell but it doesn't work (i.e. it does nothing).

E.g: In A1 validation =(Has_formula=TRUE)

I'm intrigued, why doesn't this stop a user from inputting a constant? :confused:

Edit: Furthermore I have learned that this does work on conditional format. Bizarre?

Best regards
Jon
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I have no idea why that validation approach does not work - but how about this...

While it does not validate just the cells containing formulas, you can select the entire worksheet and enter this Data Validation formula:

=CELL("protect",A1)=0

This will allow you to prevent changes to all locked cells, even if the sheet is not protected. Just run through the worksheet and unlock the cells you will allow the user to change. Certainly not foolproof, but perhaps enough to protect your formulas from the casual Excel user.
 
Upvote 0

Forum statistics

Threads
1,215,339
Messages
6,124,370
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top