#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Rows


Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "D").Value = " v " Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub


This code deletes rows with " v " in Column D but only does it on th
sheet i am in when i run it, how do i get it to go through all th
sheets in the workbook to check for " v " and delete them as well.

Many Thank

--
scottymellot
-----------------------------------------------------------------------
scottymelloty's Profile: http://www.excelforum.com/member.php...nfo&userid=380
View this thread: http://www.excelforum.com/showthread.php?threadid=27150

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Delete Rows

Hi
try:
Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
dim wks as worksheet

application.screenupdating=false
for eack wks in worksheets
LastRow = wks .Cells(Rows.Count, "D").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "D").Value = " v " Then
Rows(RowNdx).Delete
End If
Next RowNdx
next wks
application.screenupdating=true
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"scottymelloty" schrieb im
Newsbeitrag ...

Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "D").Value = " v " Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub


This code deletes rows with " v " in Column D but only does it on the
sheet i am in when i run it, how do i get it to go through all the
sheets in the workbook to check for " v " and delete them as well.

Many Thanks


--
scottymelloty
---------------------------------------------------------------------

---
scottymelloty's Profile:

http://www.excelforum.com/member.php...fo&userid=3808
View this thread:

http://www.excelforum.com/showthread...hreadid=271501


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
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
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 11:33 AM.

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"