Clear Values Containing no formulas

howard

Well-known Member
Joined
Jun 26, 2006
Messages
5,686
Office Version
  1. 2019
Platform
  1. Windows
I have a spreadsheet containing text, Values as well as values with Formulas.

I need to write VBA code to clear the values where there are no formulas. The Text must be left intact, only the values containing no formulas must be cleared.

Your assistance will be most appreciated.


Howard
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi Howard

You can probably use the SpecialCells method:

Code:
Range("A1:H100").SpecialCells(xlCellTypeConstants,xlNumbers).ClearContents

Best regards

Richard
 

howard

Well-known Member
Joined
Jun 26, 2006
Messages
5,686
Office Version
  1. 2019
Platform
  1. Windows
Hi Richard

Thanks for the help

Regards

Howard
 

Watch MrExcel Video

Forum statistics

Threads
1,118,297
Messages
5,571,401
Members
412,387
Latest member
qxyy
Top