Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub DeleteRows()
Dim i As Long, LastRow As Long LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row For i = LastRow To 1 Step -1 If Cells(i, 6) = 0 Then Rows(i).Delete Next End Sub I would like to get some help with this macro. Currently it is deleting more rows than I want it to delete. I would like it to Look at each row in Column A. If the row in Column A has contents in it than check the same row of Column F. If the contents in Column F are equal to or greater than 0 delete the row and keep deleting the rows below it until Column A has contents in it again. Repeat for every row in Column A and Column F. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Rows if any cell in Column H is blank but do not Delete Fir | Excel Programming | |||
Copy pasting Rows, but need to Delete any Shapes/Pictures that are within copied rows | Excel Programming | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
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 | Excel Programming |