LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Conditoinal Row Delete

worked like a charm. fantastic! thank you for the quick reply!

"Ryan H" wrote:

Give this a try. When you are deleting rows you want to start at the end of
the column and work up to the first row. Notice the "Step -1" syntax. Hope
this helps! If so, let me know, click "YES" below.

LastRowOfData = .Cells(.Rows.Count, "F").End(xlUp).Row
For x = LastRowOfData - 1 To 11 Step -1
If .Cells(x, "F").Value = 0 Then
.Rows(x).Delete Shift:=xlUp
End If
Next x
--
Cheers,
Ryan


"Stephen" wrote:

Hi Folks,

The code below works fine to hide the given row but I'd really like to
delete the row and i can't seem to make ".Cells(x, "F").EntireRow.Delete"
work for me.

LastRowOfData = .Cells(.Rows.Count, "F").End(xlUp).Row
For x = 11 To LastRowOfData - 1
If .Cells(x, "F").Value = 0 Then
.Cells(x, "F").EntireRow.Hidden = True
End If
Next

What am I missing?

TIA!

 
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
contain option in conditoinal formating Vijay Excel Discussion (Misc queries) 2 June 11th 09 09:30 AM
format color without conditoinal formating WT Excel Worksheet Functions 3 August 6th 08 12:19 AM
Conditoinal format trouble bludovico Excel Discussion (Misc queries) 3 June 16th 06 04:35 PM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 1 June 22nd 05 01:12 AM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 03:45 PM.

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"