0

I've made a calculator which calculates gross and net value depending on tax. Something like this:

Gross   |   Tax   |   Net
--------------------------
100     |  10%    | is calculated when gross and tax value is inserted
is calculated when net and tax value is inserted   |   10%   |   100

So depending on gross/net value inserted and the tax, net/gross value is calculated. This is an excel spreadsheet which will be uploaded in SkyDrive and used as an interactive Web App.

The problem is when user deletes some data in the cell (clears the cell) formula is deleted. Is there any way to disable deleting formula. To make the cell same as it was on init or some VBA macro?

I've been searching answer for all day and please don't suggest me F5-go to-constant-numbers because that is not the solution I need. Any advice would be appreciated. Thank you

pnuts
  • 58,317
  • 11
  • 87
  • 139
enigmaticus
  • 548
  • 3
  • 8
  • 26
  • 1
    if its still within excel you can lock the cell for editing. [See this post to get some ideas](http://stackoverflow.com/questions/16684297/hiding-formulas-in-formula-bar) –  May 22 '13 at 14:26
  • hmm, I need to edit this cells since user will have to enter gross, net and tax – enigmaticus May 22 '13 at 14:58
  • or you can place the formula there through VBA, on worksheet_change method with the target as parameter should give you an idea how to make this work –  May 22 '13 at 15:14

1 Answers1

0

It sounds like you want users to be able to add or delete data in the Gross and Tax cells, but not in the Net cell, since that is calculated with a formula.

You can select the Gross and Tax cells (and any other cells you want the user to have permission to edit), right click, and choose Format Cells. Uncheck locked. Then right click the worksheet tab at the bottom of the page, choose Protect, and click OK. Now the user can only edit the cells for which you gave permission, and cannot edit the cell with the formula.

HaveSpacesuit
  • 3,572
  • 6
  • 40
  • 59