VBA Code to remove color if cell is blank

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
157
Hi Can someone help me with the code that if cell is blank then remove color from the entire column in one go.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Use special cells, you may need an error trap incase there are no blanks..

Code:
    On Error Resume Next
    Range("A2:N24").SpecialCells(xlCellTypeBlanks).EntireColumn.Interior.Color = xlNone
    On Error GoTo 0
 
Upvote 0
Select the column of your cell, then change the interio pattern

Code:
    Columns(Selection.Column).Select
    Selection.Interior.Pattern = xlNone
 
Last edited:
Upvote 0
Sorry Richard but this is remove color from entire column however what i need of cell is not blank then it should not remove color.
 
Upvote 0
Sorry Richard but this is remove color from entire column however what i need of cell is not blank then it should not remove color.
That means your cells are not blank, rather, they have formulas in them that are displaying the empty text string (""), correct? If so, what kind of values are in the cells that are not "blank"... numbers, text or a combination of numbers and text?
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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