#1   Report Post  
Patience
 
Posts: n/a
Default Delete shaded cells

Hi. I have a rather large spreadsheet in Excel XP, and there are cells
scattered throughout that are shaded pale yellow. I need to delete those from
the sheet before performing some calculations.
Can you help me with a code that will do just that, or do I need to manually
go through every column and remove the shaded cells by hand?
Thanks,
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

Try this macro:

Sub ClearYellow()
Set rng = ActiveSheet.UsedRange
Application.ScreenUpdating = False
For Each cell In rng
With cell
If .Interior.ColorIndex = 36 Then
.ClearContents
End If
End With
Next
Application.ScreenUpdating = True
End Sub

Put it in a standard module and run with Tools Macro
Macros, see:

http://www.mcgimpsey.com/excel/modules.html

HTH
Jason
Atlanta, GA

-----Original Message-----
Hi. I have a rather large spreadsheet in Excel XP, and

there are cells
scattered throughout that are shaded pale yellow. I need

to delete those from
the sheet before performing some calculations.
Can you help me with a code that will do just that, or

do I need to manually
go through every column and remove the shaded cells by

hand?
Thanks,
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shaded cells won't print shaded Linda C Excel Worksheet Functions 4 April 3rd 23 06:59 PM
How do I count shaded cells Randy Excel Worksheet Functions 19 February 3rd 05 11:35 PM
Locate and delete specific cells David Smith Excel Discussion (Misc queries) 1 January 19th 05 04:45 PM
Count number of shaded cells Maddoktor Excel Discussion (Misc queries) 2 December 20th 04 08:35 PM
Delete contents of unprotected cells in workbook BD7447 Excel Worksheet Functions 1 November 6th 04 05:41 PM


All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"