Thank you, Ron de Bruin for your reply. It is column E but later in the
Excel doc it is column F. If cell in those columns are blank, then I
want to delete, hide or suppress the row the cell is in.
If you want to hide use
..Rows(Lrow).Hidden = True
Sub Example2()
Dim Lrow As Long
Dim CalcMode As Long
Dim StartRow As Long
Dim EndRow As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.DisplayPageBreaks = False
StartRow = 1
EndRow = 100
For Lrow = EndRow To StartRow Step -1
If Trim(.Cells(Lrow, "E").Value) = "" Or _
Trim(.Cells(Lrow, "F").Value) = "" Then .Rows(Lrow).Delete
Next
End With
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub
This is very much what I want! Thank you so much for your reply.
I actually have two command buttons. One will use your code, and th
other one will unsuppress the rows. So, is there anothe
function/method instead of "delete" that could be used? If yes, wha
would the code look like for both command buttons?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.