Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to Delte Multiple Rows Given a Value Existing


Many thanks Dave that worked great !!!

Except that it only deletes the entries on one worksheet.

How would i use this code on EVERY worksheet in the active workbook?

Thanks agai

--
Jak
-----------------------------------------------------------------------
Jako's Profile: http://www.excelforum.com/member.php...nfo&userid=871
View this thread: http://www.excelforum.com/showthread.php?threadid=27169

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default How to Delte Multiple Rows Given a Value Existing

oops. I didn't notice that last part:

Option Explicit
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Dim wks As Worksheet

Application.ScreenUpdating = False

For Each wks In ActiveWorkbook.Worksheets
With wks
lastrow = .Cells(.Rows.Count, "F").End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
Select Case LCase(Cells(row_index, "F").Value)
Case Is = "yellow", "green", "red", "blue"
.Rows(row_index).Delete
End Select
Next row_index
End With
Next wks

Application.ScreenUpdating = True
End Sub

But are you still sure you want to start at lastrow-1?

Jako wrote:

Many thanks Dave that worked great !!!

Except that it only deletes the entries on one worksheet.

How would i use this code on EVERY worksheet in the active workbook?

Thanks again

--
Jako
------------------------------------------------------------------------
Jako's Profile: http://www.excelforum.com/member.php...fo&userid=8710
View this thread: http://www.excelforum.com/showthread...hreadid=271697


--

Dave Peterson

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
delte multiple blank rows in excel Steve Dont know how George Excel Worksheet Functions 8 October 7th 06 12:15 AM
How to Delte Multiple Rows Given a Value Existing Jako[_90_] Excel Programming 1 October 24th 04 12:32 AM
How to Delte Multiple Rows Given a Value Existing Jako[_89_] Excel Programming 0 October 23rd 04 09:52 AM
How to Delte Multiple Rows Given a Value Existing Jako[_88_] Excel Programming 1 October 22nd 04 11:34 PM
Delte blank rows between different sections of data Steven R. Berke Excel Programming 2 July 27th 03 01:06 AM


All times are GMT +1. The time now is 11:47 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"