Forum Discussion

bobsampson's avatar
bobsampson
Copper Contributor
Oct 15, 2021

Changing data value in Excel cell also overwrites function

I created a simple pounds and kilograms unit conversion. However when I try to change the value in the cell, it also overwrites the function. Is there any way to change the value without changing the function?  In the image below, I want to change the value of kilograms from 1587.6 to 1400 to see what it is in pounds. However when I double click the cell and change the value to 1400, it changes the function along with it to 1400. I would like to make it where the function is permanent and cannot be changed when I try to input a value of data. Thanks in advance! 

 

 

1 Reply

  • bobsampson 

    That is not possible. A cell can contain a fixed value or a formula, not both.

    But you can use VBA code to accomplish it.

    See the attached workbook. You'll have to allow macros when you open it.

    To view the code, right-click the sheet tab and select 'View Code' from the context menu.