PC Review


Reply
Thread Tools Rate Thread

Default Cell Formatting

 
 
scott
Guest
Posts: n/a
 
      17th Dec 2007
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.?


 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      17th Dec 2007
> 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
 
Reply With Quote
 
carlo
Guest
Posts: n/a
 
      17th Dec 2007
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
 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      17th Dec 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default values for cell formatting and Pivot tables Idoia Microsoft Excel Misc 1 7th Jun 2008 02:36 AM
Find formatting in text in cell, insert tags around formatting. CarlC Microsoft Excel Programming 2 27th Feb 2008 09:26 PM
default cell formatting for negative numbers Hii Sing Chung Microsoft Excel Discussion 3 3rd Jun 2006 07:43 PM
How do I change the default cell formatting to be text? =?Utf-8?B?bW9qaXRzdQ==?= Microsoft Excel Misc 2 18th Aug 2005 05:37 PM
Default..cell formatting Jeff Dougherty Microsoft Excel New Users 2 26th Mar 2004 01:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.