excel vba
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA

Excel VBA

resolvedResolved · Low Priority · Version 2003

replyReply Wed 26 Nov 2008, 10:23Delegate Beyers said...

Beyers has attended:
Excel VBA Advanced course

Excel VBA

Is there any way of removing all formatting from cells(shading, borders, font style/colour etc) at once using VBA code?

For upcoming training course dates see: Pricing & availability

replyReply Thu 27 Nov 2008, 10:09Trainer Stephen said...

RE: Excel VBA

Hi Beyers

Thank you for your question

Removing all the formatting involves manipulating multiple propeties of different objects (Font, Interior etc.). The quickest way would be to use a with structure.

For example

With RangeObject

.interior.colorindex = xlNone
.font.italic = false
.font.bold = false

End with

Regards

Stephen

Wed 3 Dec 2008: Automatically marked as resolved.

 

Please browse our web site to find out more about
best training excel intermediate and other Microsoft training courses.

Excel tip:

Select only cell that contain text to lock format

For selecting cells that only contain Text in Excel

By selecting cells that only contain text, you can delete, fill or protect cells of this type.

Use short cut to Go to box (F5) or Edit, Go to
In the dialog box, click special button & select Constants and only check text or any other desired type.

Click OK.

And text cells will all be highlighted for you to apply format. Please note only works on one sheet at a time.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard