can I clear a cell's contents and retain the formula in that cell?

keithmct

Active Member
Joined
Mar 9, 2007
Messages
254
Office Version
  1. 2021
Platform
  1. Windows
I have a range of cells on one input sheet that is automatically copied over to an order form. Formula in order form cells is =Home!E14 etc.
Now that we have 2 suppliers I need to remove (clear contents of that row or range) orders on the order form, column J, that starts with JPM, but clearing contents deletes the formula =Home!E14
any ideas?
I've looked at Go To Special which doesn't apply as far as I can tell.
I've used this code:

https://www.rondebruin.nl/win/s4/win001.htm

from Ron De Bruin which deletes the rows but then I'd have to add back rows with formulas in them to my order template for other things to work properly.
I'm pretty stumped at this stage.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
If you clear the contents at Home!E14, then the formula will result in NULL.

So no, you can't clear the cell with a formula and have it retain the formula.
 
Upvote 0
I dont want to clear Home!E14, I want to clear the cell on the order form that looks at Home!E14 and duplicates the value there. Then I run some sort of code to remove the unwanted stuff from the order form sheet & the next time I use the spreadsheet it all has to go back to normal again.
 
Upvote 0
You can't clear a cell and retain a formula. By the sound of it you either need to use code to replace the formula or look at setting up the order form as a template.
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,569
Members
449,038
Latest member
Guest1337

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