View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Mark Ivey[_2_] Mark Ivey[_2_] is offline
external usenet poster
 
Posts: 171
Default Deleting a row that has a zero in column A

Glad it worked out...

Please thank David McRitchie for his help as well. This macro came from his
site.

Mark

"Bob" wrote in message
...
Thanks - the loop macro worked fine.
--
Bob


"Mark Ivey" wrote:

Take a look at the following website:
http://www.mvps.org/dmcritchie/excel/delempty.htm

Go down until you see the information for:
Delete ALL rows that have cell in Column A that looks blank

This is a very mildly altered version from David's site to delete rows in
column A that contain a ZERO:
Sub DeleteRowsThatLookEmptyinColA()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual 'pre XL97 xlManual
Dim Rng As Range, ix As Long
Set Rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For ix = Rng.Count To 1 Step -1
If Trim(Replace(Rng.Item(ix).Text, Chr(160), Chr(32))) = "0" Then
Rng.Item(ix).EntireRow.Delete
End If
Next
done:
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

Mark

"Bob" wrote in message
...
I would like to know how I would build a macro that deletes an entire
row
that has a zero in column A. For example, my column A has values
greater
than 0 until the end of the report and then the values are all be
zeros:

16
10
8
7
5
0
0
0

I would like a macro that deletes the entire row that has a zero in
column
A.

Thanks.

Bob


--
Bob