Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Maria Silva   on Sep 03 In MS Office Category.

  
Question Answered By: Alexander Fields   on Sep 03

This assumes that you are on the correct worksheet. That column 1
contains the zero values. That the data  starts in row 1.

Sub DeleteRows()
'' Checks cells in first column for 0. Deletes these rows.

Dim lngRow As Long, lngL As Long

With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With

lngRow = Cells(65536, 1).End(xlUp).Row

For lngL = lngRow To 1 Step -1
If Cells(lngL, 1).Value=0 Then Cells(lngL, 1).EntireRow.Delete
Next lngL

With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With

End Sub

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Macro to Suppress Rows w/ Zero Value Or get search suggestion and latest updates.


Tagged: