View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RSnyder RSnyder is offline
external usenet poster
 
Posts: 2
Default Deleting rows based on cell criteria

If everyline has something in it on the column B cell use this otherwise you a terminating value to no when this would terminate

Worksheet("worksheet name").Activat
If moCurrCell.Value = "Credit Rating: Foreign Currency" The
Selection.EntireRow.Delet
Set CurrLine = Range("B1"
Set NextLine = CurrLine.Offset(0, 1
CurrLine.Selec
D
If CurrLine.Value = "Credit Rating: Foreign Currency" The
Selection.EntireRow.Delet
End I
Set CurrLine = NextLin
Set NextLine = CurrLine.Offset(0, 1
CurrLine.Selec
Loop Until CurrLine.Value = "

Change "Loop Until CurrLine. Value = " comparison of "" to "xx" if you know that the last line has an "xx" in it.