PDA

View Full Version : Solved: Vba code to clear data cells only not those with formula



BENSON
10-21-2012, 11:40 PM
Could some one help me with some code that will clear all the cells of a selected range that contain data but not cells in the same range that contain formulas

Thanks

Bob Phillips
10-22-2012, 01:19 AM
Off the top

For Each cell In Selection

If Not cell.HasFormula Then

cell.ClearContents
End If
Next cell