Is it possible to clear a large number of cells contents based on color alone? I don't think that simply filtering is going to work well on this because the dataset is large and 'wide'
If you don't need this done programatically, it can be faster to just use Find and Replace (Ctrl-H).
Ctrl-H
Options > >
Format...
button to search for for colored cells (use the Fill
tab)Replace with
field blank to delete the contents of cells with the format you specified.This will clear the content of any cell within the range A1:G8 filled with yellow (65535). Change the color for your color and the range for your range. This is kind of crude, sorry.
Sub Macro1()
Range("A1:G8").Select
For Each Cell In Selection
If Cell.Interior.Color = Excel.XlRgbColor.rgbYellow Then
Cell.Clear
End If
Next
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With