Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default do..loop

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"

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DO LOOP in VBA Brettjg Excel Discussion (Misc queries) 5 April 24th 07 12:42 AM
Do Loop BobBarker Excel Worksheet Functions 0 August 23rd 05 08:33 PM
Do Loop BobBarker Excel Worksheet Functions 0 August 19th 05 08:44 PM
Do Loop BobBarker Excel Worksheet Functions 0 August 19th 05 07:45 PM
Do Loop BobBarker Excel Worksheet Functions 0 August 19th 05 06:54 PM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"