LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help With a Loop That Deletes Rows

I have an Excel sheet that has 3 columns. Column 1 is the same throughout -
HQCCA1. What I would like is to start at row 1 and look at Column 3 and if
the data in row 1 is XS, then delete the row. Otherwise, go on to the next
row and look to see if it is XS, etc through to the end of the sheet. Here
is what I wrote and nothing happens (I must admit I tried using a sample to
do this.):

Sub LoopRange1()
x = ActiveCell.Row
y = x + 1
Do while Cells(x,1).Value = HQCCA1
If Celss (x,3).Value = "XS" Then
Cells(x,1).EntireRow.Delete
Else
y = y + 1
End If
Loop
x = x + 1
y = x + 1
End Sub


 
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
Deleting Rows - only deletes content Phil Excel Discussion (Misc queries) 2 March 12th 10 04:43 PM
Macro that deletes rows from cell containing End to end of data. Richard Excel Discussion (Misc queries) 2 July 25th 07 03:51 PM
shared file adds or deletes rows woodman Excel Discussion (Misc queries) 0 May 31st 07 04:46 PM
Copy to in Adv filter deletes data in lower rows Hari Excel Discussion (Misc queries) 0 May 30th 06 10:20 AM
Macro that deletes certain rows and not others Roger[_20_] Excel Programming 8 May 3rd 05 12:02 AM


All times are GMT +1. The time now is 07:15 AM.

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

About Us

"It's about Microsoft Excel"