Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

delete highlighted rows

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Delete highlighted rows

Delete highlighted rows

ResolvedVersion 2010

Tashi has attended:
No courses

Delete highlighted rows

I have a spreadsheet with half the rows highlighted in yellow. I want to delete the rows with the background highlighted in yellow and keep the rows with "no fill" or no highlighting. How do I do this?

On the same topic, after I have conditionally formatted and so highlighted some cell values (e.g. if over 500), how do I delete all the highlighted cells or replace them with 0?

Thank you for your help.

RE: Delete highlighted rows

Hello Tashi,

Thank you for your question regarding conditional deleting of rows.
This could be achieved through VBA code. The following code will delete any rows that are coloured standard yellow. You may be able to adapt this to suit your needs. You can specify any colour by using the RGB value instead of the standard vbyellow Ive used here for demonstration purposes.

You could easily alter this code to achieve the answer to your second question.

sample code:

Sub DeleteRows()
Range("A1").Select

Do Until ActiveCell = ""
If ActiveCell.Interior.Color = vbYellow Then
ActiveCell.Rows.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

End Sub


I hope this resolves your question. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Mark
Microsoft Office Specialist Trainer

Will be marked as resolved in 5 days

Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.

Wed 27 Apr 2011: Automatically marked as resolved.

Excel tip:

Create your own custom list on Excel 2010!

If you know how to use the auto-fill option on Excel then why not create your own customs lists?

The auto fill feature saves you time by allowing you to enter one of the list entries into a cell and then use your mouse to automatically drag the rest of the list into the cells below, above or to either side of the initial cell. When using your mouse to perform this task you will see a thin black cross appear at the bottom right hand side of the cell. Click, hold and drag to make the list appear.

Default lists include weekdays and months. To create your own list in Excel 2010 do the following;

>File
>Options
>Advanced
>Scroll right to the bottom of the page and you will see a buttom "edit custom lists", click this button
>enter your list in the list entries
>click add

Now try it out. Good luck.
>

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.