Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete the contents of all cells which dont contain formulae
Please can anyone help with a method of deletiong all values except formulae
from a range of cells in single and multiple worksheets? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete the contents of all cells which dont contain formulae
One way:
Choose Edit/Go To.../Special, select Constants from the dialog. Then Edit/Clear All. In article , Warby wrote: Please can anyone help with a method of deletiong all values except formulae from a range of cells in single and multiple worksheets? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete the contents of all cells which dont contain formulae
First save your workbook.
Hit F5 Special select Constants OK out while highlight all values press Delete key "Warby" wrote: Please can anyone help with a method of deletiong all values except formulae from a range of cells in single and multiple worksheets? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete the contents of all cells which dont contain formulae
Select your range of cells and run:
Sub clear_val() For Each r In Selection If r.HasFormula Then Else r.Clear End If Next End Sub repeat for other worksheets -- Gary''s Student - gsnu200765 "Warby" wrote: Please can anyone help with a method of deletiong all values except formulae from a range of cells in single and multiple worksheets? |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete the contents of all cells which dont contain formulae
Select the range first--be sure not to include the cells that contain labels
that you want to keep (headers/instructions). Then edit|Goto|Special|Constants and click ok. The original selection will be reduced to just the cells that contain constants. Then hit the delete key on the keyboard. In code, you can loop through the worksheets like: Option Explicit Sub testme() Dim wks As Worksheet On Error Resume Next For Each wks In ActiveWorkbook.Worksheets wks.Cells.SpecialCells(xlCellTypeConstants).ClearC ontents Next wks On Error GoTo 0 End Sub But this will clear the contents of all cells with values--including headers. I'd be careful. Warby wrote: Please can anyone help with a method of deletiong all values except formulae from a range of cells in single and multiple worksheets? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete contents unlocked cells | Excel Discussion (Misc queries) | |||
Delete contents in cells with macro | Excel Discussion (Misc queries) | |||
Delete contents of cells | Excel Worksheet Functions | |||
How do I delete the contents of unprotected cells only? | Excel Discussion (Misc queries) | |||
Delete contents of unprotected cells in workbook | Excel Worksheet Functions |