#1   Report Post  
Old December 1st 04, 10:56 PM
Posts: n/a
Default delete rows

i would like to run a macro that does the following.
start at row 2
if L2 and m2 and n2 are all zeros then delete row
if not then go to next row and do the same check.

the macro should end once the "L" field is blank.

let me know if more info is need



  #2   Report Post  
Old December 2nd 04, 12:33 AM
Bill Manville
Posts: n/a

Dd wrote:
i would like to run a macro that does the following.
start at row 2

It's easier to start at the end and work back.

Sub DeleteRows()
Dim lRow as Long
lRow = ActiveSheet.UsedRange.SpecialCells(xlLastCell).Row
Do Until lRow = 1
If Cells(lRow, "L")=0 And Cells(lRow, "M")=0 And Cells(lRow, "N")=0
End If
lRow = lRow-1
End Sub

An alternative would be to use AutoFilter and delete all the visible

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

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
Multiple rows of data on a single axis (charting) ramseysgirl Charts and Charting in Excel 8 December 29th 04 07:00 PM
Delete Chart agac8103 Charts and Charting in Excel 3 December 13th 04 05:54 AM

All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright 2004-2022 ExcelBanter.
The comments are property of their posters.

About Us

"It's about Microsoft Excel"


Copyright © 2017