View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sharad Sharad is offline
external usenet poster
 
Posts: 123
Default 2 more questions explanation

How are you deleteing the data?
You can use CleaContents to delete the data. Before doing this check if
the cell HasFormula, if not then ClearContents.

Please see code below, which will clear the data in all worksheets in
workbook except the one, name of which you enter below in place of
Main_Sheet_Name_Here. But it will keep all formulae.

Dim c, sh
For Each sh In ThisWorkbook.Sheets
If sh.Name < "Main_Sheet_Name_Here" Then
For Each c In sh.UsedRange
If Not c.HasFormula Then c.ClearContents
Next c
End If
Next sh

Sharad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!