delete rows in which the result of the formula is " "
this is the same (basically) as gary's, but the variables are
declared..........
===========================
Option Explicit
Sub step_backwards()
Dim myLastRow As Long
Dim r As Long
Dim c As Range
myLastRow = ActiveSheet.Cells(10000, 1).End(xlUp).Row
For r = myLastRow To 1 Step -1
Set c = ActiveSheet.Range("a" & r)
If c.Value = "" Then
c.EntireRow.Delete
End If
Next r
End Sub
=========================
again, it looks for blanks in column A.
hope it helps
susan
On Jul 15, 2:08*pm, marcia2026
wrote:
Sorry. *I spoke too soon. *Actually, this one didn't work either.
"marcia2026" wrote:
worked. *Thanks
"Gary''s Student" wrote:
Sub remove_rows()
cl = "A"
n = Cells(Rows.Count, cl).End(xlUp).Row
For i = n To 1 Step -1
* * If Cells(i, cl).Value = "" Then
* * * * Cells(i, cl).EntireRow.Delete
* * End If
Next
End Sub
looks for blanks in column A. *Adjust to suit your needs.
--
Gary''s Student - gsnu200795
"marcia2026" wrote:
This is my formula in each row in my table has an if/then statement to pick
up corresponding values from the same rows in other worksheets if the value
in the subsequent worksheet is greater than 0, otherwise leave blank. *Now I
want to be able to delete the rows with a "" value. *I have tried to write a
Do/Until loop to look at each row in the table, but I cannot figure out how
to word the statement telling it what to do when it encounters the "" values.- Hide quoted text -
- Show quoted text -
|