Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Delete Row IF

I have a table begining in Row 9 that I need to delete the entire row,
if any cell in Column "F" is =0 or if any cell in Column "J" begins
with "05" or "340". There are a dynamic number of rows in the table.
TIA

Greg

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Delete Row IF

Save your data before testing:

Sub delit()
Dim eRow As Long
Dim i As Long
eRow = Cells(Rows.Count, 6).End(xlUp).Row
For i = eRow To 9 Step -1
If Cells(i, 6).Value = 0 _
Or Left(Cells(i, 10).Value, 2) = "05" _
Or Left(Cells(i, 10).Value, 3) = "340" Then
Rows(i).EntireRow.Delete
End If
Next i
End Sub

Hope this helps
Rowan

GregR wrote:
I have a table begining in Row 9 that I need to delete the entire row,
if any cell in Column "F" is =0 or if any cell in Column "J" begins
with "05" or "340". There are a dynamic number of rows in the table.
TIA

Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Delete Row IF

Rowan, thank you very much...................

Greg

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
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 05:16 PM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 05:11 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:54 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 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 03:39 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"