G
gti_jobert
Hi all,
Trying to loop through entire woorksheet and then based on cell
criteria (empty or not) delete the entire row. I have the following
implemented....but dows not work;
Code:
--------------------
Private Sub cmdFilter_Click()
'Copy Data Sheet & Paste Data onto a New Sheet
Cells.Select
Selection.Copy
Worksheets.Add
ActiveSheet.Paste
ActiveSheet.Rows(1).Select
Selection.Delete
'Delete rows that are not needed
strMySheet = ActiveSheet.Name
Sheets(strMySheet).Select
Sheets(strMySheet).Cells(1, 1).Select
i = 1
Do
If (Cells(i, 4).Value = "") And (Cells(i, 5).Value <> "") Then
Sheets(strMySheet).Cells(i, 1).Select
Selection.EntireRow.Delete
End If
i = i + 1
Loop Until (Sheets(strMySheet).Cells(i, 1).Value <> "")
End Sub
Trying to loop through entire woorksheet and then based on cell
criteria (empty or not) delete the entire row. I have the following
implemented....but dows not work;
Code:
--------------------
Private Sub cmdFilter_Click()
'Copy Data Sheet & Paste Data onto a New Sheet
Cells.Select
Selection.Copy
Worksheets.Add
ActiveSheet.Paste
ActiveSheet.Rows(1).Select
Selection.Delete
'Delete rows that are not needed
strMySheet = ActiveSheet.Name
Sheets(strMySheet).Select
Sheets(strMySheet).Cells(1, 1).Select
i = 1
Do
If (Cells(i, 4).Value = "") And (Cells(i, 5).Value <> "") Then
Sheets(strMySheet).Cells(i, 1).Select
Selection.EntireRow.Delete
End If
i = i + 1
Loop Until (Sheets(strMySheet).Cells(i, 1).Value <> "")
End Sub