VBA: Remove Formatting For Each Cell In Range

August 14th, 2004 | Categories: VBA | Tags:
-->

When formatting a cell in excel using VBA you may want to make sure you are starting with a clean slate, or removing any possible formatting already on a cell. You can do this by using ClearFormats.

The following example will eliminate the formatting for each cell in a range using a loop:

Public Sub RemoveFormatting()
Dim c As Range

For Each c In Range("A:A")
     c.ClearFormats
Next c

End Sub
 
Can't get the tutorial to work for you? Need help with your code?
Get answers right away at our AE Excel Support Forums!
No comments yet.