Protecting formulas but allowing data entry

Alex Ondrick

New Member
Joined
Nov 23, 2005
Messages
9
In advance, I'd like to apologize in the event I've created a duplicate thread. I had spent some time searching around the forums for a similar problem or solution, but I was not able to find anything. Either that, or I'm just a bad searcher :LOL:

Anyway, I have a spreadsheet here for a form. There are cells which have formulas in them, which connect to other "IF" statements. However, I want to allow for data entry into said cells in the event that the dropdown bar does not contain the data needed.

Here's the kicker: If possible, the cell would accept new data entered. But if the data is removed, then it reverts back to the formula that was previously entered.

Thanks in advance my comrades!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
give us more info on the cells in question & the formulas in them & the the mechanics of what is going on.
 
Upvote 0
Hi, Alex,

seems nobody likes this one, although you are bumping soon
let me try

what do you mean by
in the event that the dropdown bar does not contain the data needed.

Here's the kicker: If possible, the cell would accept new data entered. But if the data is removed, then it reverts back to the formula that was previously entered.
is this a possible scenario ?
put value in a cell which has a formula
close the file
delete the value ==> formula will be filled in again

can you clarify on where those formulas are ?

couldn't you instead of this procedure do something like in the spreadsheet below ?
formula D2 is comparing B2 with A2, but if there is a value in C2, B2 will be compared to C2 to get the result
D2: =IF(IF(C2="",A2,C2)< B2,"ok","error")
Map1
ABCD
1formulainputresult
291112error
345
456
Blad1

kind regards,
Erik
 
Upvote 0
Erik and Paddy, thanks for replying.

To clarify, I am trying to preserve the formula: =IF(A21>1,VLOOKUP(A21,look,2,0)," ")

On occasion, I would like to be able to enter data into the cell containing that formula. However, as soon as I enter text into that cell, the formula disappears. If possible, I am trying to preserve that formula by either hiding it or protecting it so that if the "custom text" entered into the cell is deleted, the formula re-appears.

I hope that clarifies my problem :)

If it is still too vague, I apologize and will try to clarify more if needed.
 
Upvote 0
In general, a cell contains either a formula or data, not both. You would be much better advised to set up you sheet to have an area for data entry, an area for formulas, and construct the latter to cope with what you need than try to use vba to gerrymander excel into processes in conflict with its basic design.

Eric has given an example of exactly that - if there's a value in a data entry cell, the formula does one thing, otherwise it does something else.

that said, the vba could still be done, but it's not really my thing...
 
Upvote 0
Gotcha...I'll try and rig it with the formula in another cell and just wire a cell for data entry to tie with the other cell if needed.

I was basically trying to give the user the option of entering custom text into a dropdown bar if the number/item they needed wasn't listed under the dropdown bar.

Thanks for all the help again!

Let me know if you have any ideas or better ways on how to accomplish something like that :/
 
Upvote 0
"I was basically trying to give the user the option of entering custom text into a dropdown bar if the number/item they needed wasn't listed under the dropdown bar. "

You can set up data validation to give users a list of options but still let them type something into the cell - just set up the data validation as normal, but on the 'error alert' tab, de-select the show error message option.
 
Upvote 0
Unfortunately, even with the error messages disabled, the formula is gone after new data is put in. As mentioned before, it's probably not the best idea to have the two different types of entry/data in one cell.

On a whole, I probably should of made this form in VB or something of the sort. It's going to be used-reused type of thing for sales quotes and the like. At the least, I'll just post a read-only file to the master server and let people exhaust the 5 available lines of pre-filled formulas that correspond to dropdown bars. If they want to put in custom data after deleting the formulas, they'll just have to re-open the sheet :D

By the way, if you can't already tell, I'm a sales-marketing guy with a very limited knowledge of Excel :)
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,513
Members
448,967
Latest member
screechyboy79

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