Fabulist

Board Regular
Joined
Jan 28, 2014
Messages
107
Hello,

Would it be possible to clear the formatting cells that do not contain anything, including text, and are also not filled with color?

There is a massive spreadsheet, that has had multiple rows inserted over the years, which rows have shared the same formatting (usually alignment, bold or not) of their preceding row, but are empty and can be restored to their default condition as with real unformatted cells (e.g. default formatting of a new sheet). All filled cells (color, pattern, etc.) are to remain as they are/

Is this possible with VBA or any other way? I cannot figure out if this is possible simply with find and replace.

Attached, a file where only formatting of cells with no values of any kind or fill should be cleared (e.g. A1 to B1 & A17 to B17 but not I15 to I17 etc.)
New Microsoft Excel Worksheet

Thank you in advance.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try something like this

VBA Code:
Sub clearformatEmptycells()
'Change sheet name
Sheets("Sheet1").UsedRange.SpecialCells(xlCellTypeBlanks).ClearFormats

End Sub
 
Upvote 0
Thanks, but your code clears the formatting of cells that have a cell fill and either have text or are empty.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,749
Members
449,050
Latest member
excelknuckles

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