?
Solved

Remove formatting without losing formulas or grouping in Excel

Posted on 2012-03-30
4
Medium Priority
?
282 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 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

764 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