Thread: do..loop
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Anna Anna is offline
external usenet poster
 
Posts: 132
Default do..loop

The coding seems delete cells (in column b) but not the entire row!! Would
you please tell me what should I do?
Thanks

"Toppers" wrote:

try:

If ACTIVeCELL= Range("A1") Then

"Anna" wrote:

I would like to compare each cell in column B (which is month) with cell A1
(showing this month). If the text in cell A1 is same as column B, then keep
the row. Otherwise, delete the row. I don't what's wrong with below coding!!
Anyone can help me or any other good sugguestion?
Thank you for your help.

Range("B6").Select

Do

If ACTIVCECELL.Text = Range("A1").Text Then
ActiveCell.Offset(1, 0).Select
Else
Selection.Delete Shift:=xlUp
End If
Loop Until ActiveCell.Text = "END"