![]() |
Selection.ClearContents for data only
Is it possible to clear the data without clearing the formulas?
I have an area of the sheet which is mostly data which needs to be cleared before updating. A few cells have formulas attached. Rich |
Selection.ClearContents for data only
One way:
On Error Resume Next 'in case no constants Selection.Cells.SpecialCells(xlCellTypeConstants). ClearContents On Error GoTo 0 In article , "Richard Lawson" wrote: Is it possible to clear the data without clearing the formulas? I have an area of the sheet which is mostly data which needs to be cleared before updating. A few cells have formulas attached. |
Selection.ClearContents for data only
maybe something like this:
Sub Test() ActiveSheet.Cells.SpecialCells(xlCellTypeConstants ).Clear End Sub -- Hope that helps. Vergel Adriano "Richard Lawson" wrote: Is it possible to clear the data without clearing the formulas? I have an area of the sheet which is mostly data which needs to be cleared before updating. A few cells have formulas attached. Rich |
All times are GMT +1. The time now is 07:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com