Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Harry Hunter   on Oct 19 In MS Office Category.

  
Question Answered By: Ann Evans   on Oct 19

Try the following macro:

Sub DelIfWhiteBkgrd(Rng As Range)
Dim c As Range
For Each c In Rng
'If cell  background is white  or has no fill,
'clear the cell's contents.
If (c.Interior.ColorIndex = 2 Or _
c.Interior.ColorIndex = xlNone) Then
c.ClearContents
End If
Next c
End Sub

You call it like this, as needed:

Sub AAAA()
Call DelIfWhiteBkgrd(ActiveSheet.Range("A2:J31"))
End Sub

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Macro for One-Solution Puzzle Or get search suggestion and latest updates.


Tagged: