PC Review


Reply
Thread Tools Rate Thread

Delete data in cells that don't meet criteria

 
 
=?Utf-8?B?U0lUQ0ZhblRO?=
Guest
Posts: n/a
 
      10th Jun 2006
I'm not sure how I would code deleting any data in the cells in Column "Type"
if it is not "HO". The report I download sometimes puts odd letters in cells
in this column and I just want to clear it out rather than scan this very
long report and delete manually. I will put the code in an existing macro.
Thank you
 
Reply With Quote
 
 
 
 
Paul B
Guest
Posts: n/a
 
      10th Jun 2006
sitcfantn, here is one way

Sub Delete_HO()

Dim iRow As Long
Dim SpecValue As String

SpecValue = "HO"

If SpecValue = "" Then Exit Sub

For iRow = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If Cells(iRow, 1) = SpecValue Then Rows(iRow).Delete
Next iRow

End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"SITCFanTN" <(E-Mail Removed)> wrote in message
news:35ADF4F6-B941-4222-BFA9-(E-Mail Removed)...
> I'm not sure how I would code deleting any data in the cells in Column

"Type"
> if it is not "HO". The report I download sometimes puts odd letters in

cells
> in this column and I just want to clear it out rather than scan this very
> long report and delete manually. I will put the code in an existing

macro.
> Thank you



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
count cells that meet 2 criteria aimee Microsoft Excel Worksheet Functions 3 18th Jun 2008 06:45 PM
Sum Total # Of Cells That Meet Several Criteria ashstudly Microsoft Excel Worksheet Functions 4 23rd Jan 2006 05:55 AM
Delete Rows where cells does not meet criteria =?Utf-8?B?RGFubnk=?= Microsoft Excel Worksheet Functions 1 12th Sep 2005 05:08 PM
how do i delete rows when cells meet certain criteria? Tbal Microsoft Excel Programming 1 15th Aug 2005 05:19 PM
Help I'm Stuck...Delete cells that don't meet ascending value criteria? forrie13 Microsoft Excel Misc 1 1st Dec 2003 10:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:21 PM.