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: 1
Default Can't get Rows to delete in macro


I have the following code which compiles and runs; however, it isn'
deleting rows as it should be. Basically I want the macro to chec
each row of Column O and if that value is < 3301, delete the entire ro
and shift the cels up.

The code is:

For i = 2 To 2000
If ActiveWorkbook.Worksheets(1).Cells(i, "O").Value < "" Then
If ActiveWorkbook.Worksheets(1).Cells(i, "O").Value < 330
Then
Rows(i).Delete Shift:=xlUp
End If
End If
Next

Just to make sure the loop is functioning properly I changed the delet
line to

With Row(i).Interior
.ColorIndex = 6
.Pattern = xlSolid
End With

This made every row with the value less than 3301 highlighted yellow s
the loop functions fine. Just the deleteing part of it isn't..

--
Goobie
-----------------------------------------------------------------------
Goobies's Profile: http://www.excelforum.com/member.php...fo&userid=3076
View this thread: http://www.excelforum.com/showthread.php?threadid=50756

 
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
Delete rows using a macro Sasikiran Excel Discussion (Misc queries) 2 June 3rd 09 11:42 AM
macro to delete rows Aceensor Excel Discussion (Misc queries) 5 November 14th 08 03:45 PM
Need a macro to delete rows jmr4h8 Excel Discussion (Misc queries) 9 July 2nd 08 11:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM


All times are GMT +1. The time now is 08:37 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"