I am using vb to clear the text from a range of cells but I really need to keep the formulas intact, I've tried to .range.clearcontents and range.text="" but errors keep on coming. Any clue??
Thanks a lot
Carl
Range("xxxx".ClearContents will work - where you replace "xxxx" with whatever range name you assign to the range you want cleared.
From your description, it appears you might have a situation where the range includes "input" cells "inter-mixed" with other cells containing formulas.
If you're attempting to clear all the "input" cells in one step, this IS possible, but you will need to create a range name for a "disjointed" range.
This is done by:
1) Hold down the <Control> key.
2) Use the mouse to click on all the individual disjointed cells that you want included in this one range.
3) With the <Control> key STILL held, hit <F3>
4) Type the name
5) Hit <Enter>
I hope this helps resolve your situation. If your situation is "different", and you want to email me a copy, I'd be pleased to resolve it and email the file back.
Hi - you can't clear the contents AND keep the formula. If you want formulae to show nothing when certain conditions are true (ie no data) you will need to use an IF statement in the formula eg =IF(Test=FALSE,"",ANSWER)
HTH
~Geoff~
Hi Carl
I'm assuming this is the same as your other post, in which case I replied there. My solution is basically the same as Dale's but acts dyamically (I think, I've had a bang on the head) through code. I'd love to know if it works in a real life situation!
me, beer, 2 flights of stairs!
If a man says something and there are no women there to hear him, is he still wrong?
This together with mine would be quite a powerful combo for clearing data entry sheets
MMmmmmmmmmmmm If a man says something and there are no women there to hear him, is he still wrong?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.