Excel 2007/VBA Problem

  Chas49 22:27 07 Oct 2010

I have cell containing a formula, this formula prints a total in the cell. I have after further processing to clear that cell of the content by means of VBA code, however, this wipes out the formula too.

Is there a way to clear the cell of its value but not the formula please?

  VoG II 22:49 07 Oct 2010

No, a cell can contain a formula or a value but not both.

  Chas49 22:58 07 Oct 2010

Thanks VoG™. So, would I be correct in thinking that the formula is automatically destroyed by the value obtained by it - that value being stored in the cell in which the formula was typed.

Thanks again - I'll have to think again!

  VoG II 09:31 08 Oct 2010

You might just want to hide it by making the font white

Range("A1").Font.ColorIndex = 2

  Chas49 09:41 08 Oct 2010

VoG™: Good Idea -why didn't I think of that! The odd thing is, VOG, that I have used that method on other occasions where a formula was not involved. Sometimes you just can't see the wood for the trees! Thanks again.

  KremmenUK 13:32 08 Oct 2010

If I want to hide the contents of a cell I tend to set it's custom format to ";;;"

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

What went wrong at the Designs of the Year 2017

iPhone X news: Release date, price, new features & specs

Comment regarder des séries et talk-shows américains en France ?