Macro - Clear Contents of Cells With Certain Value

Neutralizer

Board Regular
Joined
Sep 23, 2009
Messages
53
Hi,

I'm trying to validate the data in a large spreadsheet (~12k rows and 30 cols) using the 'Circle Invalid Data'.

The problem I'm having is that some cells that appear blank (including when using Chip's CellView Addin) are apparently not completely empty and are thus getting circled rather than the data errors that I'm trying to weed out. Selecting the 'blank' cells that are invalid and using 'clear contents' solves the problem, the thing is there are 1000's of these cells scattered randomly throughout the data. Not all the cells that appear blank are throwing the error, so I'm assuming the ones that are throwing the error must contain a null string or something.

Does anyone know of a macro or a method that will basically allow me to search a given range of cells, looking for any cell with an empty string in it, and then applying the clear contents command to those cells?
 
Last edited:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Nevermind, a simple two step find and replace procedure worked:

1. Ctrl+H -> Find: {Left it Blank} & Replace: =NA()
2. Ctrl+H -> Find: =NA() & Replace: {Left it Blank}

In step 2 I used 'match entire cell contents' as an option since NA() was also used as a component of other formulas.

Cheers
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top