Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
SITCFanTN
 
Posts: n/a
Default Delete data in cells that don't meet criteria

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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Paul B
 
Posts: n/a
Default Delete data in cells that don't meet criteria

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" wrote in message
...
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
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
ranking query JaimeTimbrell Excel Discussion (Misc queries) 2 February 16th 06 09:09 AM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 02:56 PM
count non blank cells which meet criteria in another column cmarsh5035 Excel Worksheet Functions 2 February 16th 05 05:32 PM
SUMPRODUCT Formula to Count Row of data Below Matched Criteria Sam via OfficeKB.com Excel Worksheet Functions 8 February 3rd 05 02:37 AM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 06:55 PM


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