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 Deleting a row based on a value in a column

Hi there!

Over the past few days I've been working on a workflow system in Excel.

One of the features that was wanted is a clear down function, which will
automatically delete all off the rows with "Y" in Sheets("Work") columns H
and I.

The only thing is I can't seem to get any form of my code to work...

The majority of snippets that require listing values in certain rows I just
just the for each cell in rows, if cell.value2 = data then object.additem...
etc.

Could someone help me with this code and let me know how I can make it
workable?

Private Sub run_cleardown_Click()
Dim data As String
data = "Y"
For Each cell In Sheets("Work").Range("H:H")
If cell.Value2 = data Then
EntireRow.Delete cell.Value2
Else
End If
Next
For Each cell In Sheets("Work").Range("I:I")
If cell.Value2 = data Then
EntireRow.Delete cell.Value2
Else
End If

End Sub

Thanks!

Kai


 
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 based on Column Critieria blackmanofsteel40 Excel Discussion (Misc queries) 1 September 7th 07 09:05 PM
Deleting a row of data based upon the value in column D Sean Excel Programming 6 October 26th 04 02:05 PM
Deleting rows based upon the value in column D Sean Excel Programming 2 October 25th 04 08:59 PM
Deleting a row based on the value in column A Steve Excel Programming 2 September 30th 04 04:06 PM
Deleting a column based on a value Todd Huttenstine[_2_] Excel Programming 3 November 30th 03 03:17 AM


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