Excel 2007/VBA Problem

  Chas49 22:27 07 Oct 10
Locked

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 10

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

  Chas49 22:58 07 Oct 10

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 10

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

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

  Chas49 09:41 08 Oct 10

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 10

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.

Surface Pro (2017) vs Surface Pro 4

20 groundbreaking 3D animation techniques

How to mine Bitcoin on Mac