Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting an entire row depending on the colour shading present

Hi all,

I need to be able to delete entire rows that have no shading and keep
those that have a specific colouring. Any help would be appreciated.

Regards,

Vipul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Deleting an entire row depending on the colour shading present

don't know how many ros and column you have. The code defines an area
bounded by the last items in Row 1 and Column A.

Sub removeshade()

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
LastCol = Cells(1, Columns.Count).End(xlToLeft).Column

Set myrange = Range(Cells(1, 1), Cells(LastRow, LastCol))

For Each cell In myrange

If cell.Interior.ColorIndex < xlNone Then
cell.EntireRow.Delete Shift:=xlUp

End If
Next cell

End Sub


"Vipul Vij" wrote:

Hi all,

I need to be able to delete entire rows that have no shading and keep
those that have a specific colouring. Any help would be appreciated.

Regards,

Vipul


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
How can colour of cell shading be fixed to one colour Tabrez Excel Discussion (Misc queries) 2 September 23rd 08 04:55 PM
cell shading depending on which day Jock Excel Discussion (Misc queries) 1 April 30th 07 05:16 PM
Cell shading depending on which day Jock Excel Discussion (Misc queries) 1 April 30th 07 03:24 PM
Formula to highlight an entire row when certain text is present. bcholin Excel Discussion (Misc queries) 3 September 6th 05 07:12 PM
Changing row colour if text string present in a cell? StargateFan[_3_] Excel Programming 3 September 10th 04 01:08 PM


All times are GMT +1. The time now is 12:33 PM.

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

About Us

"It's about Microsoft Excel"