View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin
 
Posts: n/a
Default Using control to clear spreadsheet

You can add the range in the code maybe

Range("A2:A100,C2:C50,D2").SpecialCells(xlCellType Constants).ClearContents


--
Regards Ron de Bruin
http://www.rondebruin.nl


"dvonj" wrote in message ...
Yes there are lables and such that I don't want to lose. All I want to clear
are the cells that I entered data in.

"JE McGimpsey" wrote:

What about label cells???

To clear everything:

Public Sub ClearConstants()
On Error Resume Next 'in case no constants
ActiveSheet.Cells.SpecialCells(xlCellTypeConstants ).ClearContents
On Error GoTo 0
End Sub

To clear only numeric constants:

Public Sub ClearNumberConstants()
On Error Resume Next 'in case no constants
ActiveSheet.Cells.SpecialCells(xlCellTypeConstants , _
xlNumbers).ClearContents
On Error GoTo 0
End Sub


To clear constants from only certain areas

Public Sub ClearInputConstants()
Const sInputAreas As String = "B2:C20, E2:F20, J5"
On Error Resume Next 'in case no constants
ActiveSheet.Range(sInputAreas).SpecialCells( _
xlCellTypeConstants).ClearContents
On Error GoTo 0
End Sub

In article ,
dvonj wrote:

Excel:
Is there any way to clear all cell entries EXCEPT formulas so that a
spreadsheet that needs to have new entries every month can be cleared easily
for the new month without having to work around the formulas when clearing
the cells?

I want to use a control (button) to click that will clear the sheet but not
clear the formulas and calulation cells.