ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Default Cell Formatting (https://www.excelbanter.com/excel-programming/402837-default-cell-formatting.html)

Scott

Default Cell Formatting
 
What vba code will format a cell back to Excel's default formatting with the
default borders, clear/white background, arial 10 font, normal text, etc.?



Rick Rothstein \(MVP - VB\)

Default Cell Formatting
 
What vba code will format a cell back to Excel's default formatting
with the default borders, clear/white background, arial 10 font,
normal text, etc.?


If it's the active cell.... ActiveCell.Clear

If it's a range... Range("A4:K12").Clear

Rick

carlo

Default Cell Formatting
 
Cells.clear

should work, if it doesnt, you could record a macro while setting up a
cell the way you want and use that.

hth carlo

Peter T

Default Cell Formatting
 
Another one -

Activesheet.Range("A1").ClearFormats

What both .Clear and .ClearFormats actually do is apply the workbook's
Normal style (Formats / Styles).

In a new workbook based on the default template, the Normal style's font is
set from -
Application.StandardFont & .StandardFontSize (Tools / Options / General).
After changing these settings, manually or programmatically, need to restart
Excel for them to take effect.

Regards,
Peter T

"scott" wrote in message
...
What vba code will format a cell back to Excel's default formatting with

the
default borders, clear/white background, arial 10 font, normal text, etc.?






All times are GMT +1. The time now is 09:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com