Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Delete Row if Value in Column L equals zero

Hello,

I am looks for code that will delete the entire row if the value in column L
is zero.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Delete Row if Value in Column L equals zero

lastrow = Cells(Rows.count, "A").End(xlUp).Row

Set myrange = Range("L1:L" & lastrow)
For Each count In myrange
If count.Value = "0" Then
count.EntireRow.Delete
End If
Next


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Delete Row if Value in Column L equals zero

HI Aron

Use the following code

Sub test()
Dim i, j As Integer


Set starta = ActiveSheet.Range("L1")
LR = ActiveSheet.Range("L" & Rows.Count).End(xlUp).Offset(1, 0).Row

For i = LR To 0 Step -1
If starta.Offset(i, 0).Value = 0 Then starta.Offset(i,
0).EntireRow.Delete
Next i


End Sub

Thanks

Shanu

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Delete Row if Value in Column L equals zero

This work great! Thanks!

"sharmashanu" wrote:

HI Aron

Use the following code

Sub test()
Dim i, j As Integer


Set starta = ActiveSheet.Range("L1")
LR = ActiveSheet.Range("L" & Rows.Count).End(xlUp).Offset(1, 0).Row

For i = LR To 0 Step -1
If starta.Offset(i, 0).Value = 0 Then starta.Offset(i,
0).EntireRow.Delete
Next i


End Sub

Thanks

Shanu


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 do I automatically delete a row, if one cell equals zero? Koz Excel Worksheet Functions 6 August 13th 08 08:42 PM
countif column d equals x and column a noblank Willie Wilson Excel Worksheet Functions 4 January 5th 08 10:22 PM
Delete Columns if value equals zero Freddy Excel Programming 2 November 28th 07 11:41 AM
delete every row where value equals user input Mitchell_Collen via OfficeKB.com Excel Programming 2 October 18th 07 07:10 PM
custom filter does not work when selecting 'equals' X AND 'equals' plindman Excel Discussion (Misc queries) 1 June 1st 05 11:29 PM


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