In my last blog post, I demonstrated how to highlight only certain words within cells in MS Excel. In this blog post I will demonstrate how to delete contents of cells which cells have a specific background color.
In the data set above, I want to remove the content of cells which contain background color of red. Here is the macro code that will perform this task once run.
For Each Cell In Selection
If Cell.Interior.Color = Excel.XlRgbColor.rgbRed Then
Now I will run the Macro.
Here is the outcome.
Note that the color could be changed to any given color by revising the fourth line of the code (i.e. …= Excel.XlRgbColor.rgbRed) based on the list provided in the reference list