Solved

Remove formatting without losing formulas or grouping in Excel

Posted on 2012-03-30
4
280 Views
Last Modified: 2012-03-30
Hello,

Is there a way to remove all cell formatting in a worksheet in Excel 2010 without affecting any formulas or outlining (grouping)?

For example, I know that you can Copy/PasteValue all cells in a worksheet to a new worksheet and it will remove all the formatting. But it also eliminates formulas as well as grouping and ungrouping.

I am looking for a way to preserve the formulas and grouping but lose the formatting.

Thanks
0
Comment
Question by:Steve_Brady
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 12

Accepted Solution

by:
kgerb earned 500 total points
ID: 37789027
Hello Steve,
Home tab, Editing group, Clear dropdown, Clear Formats.

Formulas will be preserved as well as grouping.

Kyle
0
 
LVL 12

Expert Comment

by:kgerb
ID: 37789100
I think by "grouping" you meant cell borders.  If so, the following macro will remove all (or most) cell formats except the cell borders.  It will also leave the formulas alone.  If you need assistance with the implementation please let me know.
Sub RemoveFormatsExceptBorders()
With Selection
     'Remove cell colors
    .Interior.ColorIndex = xlNone
     'Remove all special font properties and formatting
    With .Font
        .Size = 11
        .Bold = False
        .Italic = False
        .FontStyle = "Regular"
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
End With
End Sub

Open in new window

Kyle
0
 

Author Comment

by:Steve_Brady
ID: 37789397
>>>kgerb
Home tab, Editing group, Clear dropdown, Clear Formats.


Thanks Kyle.  I've never even noticed that drop-down before but I sure will be using it a lot from now on.  And your first response was the correct one (i.e. grouping was not referring to cell borders but to grouping rows and/or columns: Data tab > Group or Ungroup).

Thanks again.
0
 
LVL 12

Expert Comment

by:kgerb
ID: 37789528
You're welcome.  Glad to help.
Kyle
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question