Thread: DELETE ROW IF
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Atishoo Atishoo is offline
external usenet poster
 
Posts: 267
Default DELETE ROW IF

I would consider creating a user form with two text boxes one to enter the
column as per your current sub the second for your text.
give it two command buttons "ok" and "cancel"
then put your nice little sub under command button (ok) click, put same sub
in twice once following if userform1.textbox1.value <""then
and userform1.textbox2.value <""then
substituting your column criteria for textbox1.value and find criteria for
textbox2.value.

"CC" wrote:


Hello

I have this code to delete rows blank in columns at my choice
but I need also include another choice

"delete all rows if rows in X column are blank OR have a certain word (also
at my choice "


Is it possible ???
Thank you
cc
Sub DeleteEmptyRowsMain()
Dim myColm As Range
Dim LastCell As Range
Set myColm = Application.InputBox("Choose Start of column to clear",
Type:=8)
Set LastCell = Cells.Find("*", , , , , xlPrevious)
On Error Resume Next
If Not myColm Is Nothing Then
Range(myColm, Cells(LastCell.Row,
myColm.Column)).SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete
Else
MsgBox "No Range Selected", vbOKOnly, "Error"
End If

End Sub