Clear Values Containing no formulas

howard

Well-known Member
Joined
Jun 26, 2006
Messages
5,689
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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

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,689
Office Version
  1. 2019
Platform
  1. Windows
Hi Richard

Thanks for the help

Regards

Howard
 

Watch MrExcel Video

Forum statistics

Threads
1,118,791
Messages
5,574,312
Members
412,586
Latest member
Medhum
Top