Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
after clearcontents() new data is positioned below the cleared ran | Excel Programming | |||
wrong positioning of data in sheet after clearcontents() | Excel Programming | |||
Clearcontents | Excel Programming | |||
Clearcontents | Excel Programming | |||
Clearcontents | Excel Programming |