Thread: reset cells
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default reset cells

Hi David,

Jumping in late here so don't know the OP's intent, but it seems fair to
point out that .Clear as opposed to .ClearContents clears everything,
including borders, Conditional Formatting, etc.


Hence my comment to the OP:

If your intention is to delete the contents but retain formats, change:

Rng.Clear

to:

Rng.ClearContents


It is certainly fair to comment, but it is undoubtedly misleading to excise
the section of my response most directly pertinent to your comment.


---
Regards,
Norman



"David" wrote in message
...
Norman Jones wrote

Sub ClearCells()
Dim Rng As Range

Set Rng = Range("A1:A20") '<<==== CHANGE

Rng.Clear

End Sub


Jumping in late here so don't know the OP's intent, but it seems fair to
point out that .Clear as opposed to .ClearContents clears everything,
including borders, Conditional Formatting, etc.

--
David