Worksheet clearing Macros?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to write a Macro that, when activated, would clear all
the data NOT in a protected cell and leave the protected formulas alone? Or,
can this be done with regular Excel functions?

While we're at it, is it possible to use Conditional Formatting to clear
cell contents, again, leaving formulas in tact?

Thank you, everybody

Arlen
 
Hi Arlen

Sub test()
On Error Resume Next
ActiveSheet.Cells.SpecialCells(xlCellTypeConstants).ClearContents
End Sub

Manual you can do this

F5
Special
Constants
Ok
Delete
 
Arlen

To address your second question....

No. CF cannot be used to clear cell contents.


Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top