LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default need to delete all rows that are gray

Sub deleteColoredRows()

Const Gray = 15
Range("A1").EntireRow.Select
Do While ActiveCell.Value < ""
if Selection.Interior.ColorIndex = Gray
EntireRow.Delete
End If
Loop

End Sub

assuming I have the right color index number, how do I correct the if/then
line
so I can delete all rows that are gray? there is an error on the delete and
if/then lines

thanks,
 
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
Automatically gray out rows when a particular field is populated Bob Luck Excel Discussion (Misc queries) 4 August 30th 08 05:24 PM
Automatically have even numbered rows shaded gray? phillr Charts and Charting in Excel 2 February 7th 07 08:49 PM
In Excel, how do I rename the gray rows/columns (1,2,3/A,B,C)? rapunzel4040 Excel Discussion (Misc queries) 1 August 30th 05 10:35 PM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 06:59 AM.

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"