Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to delete cells with a given data?

I'm trying to delete series of cells with a given word inside, but there are
too many to FIND one by one and delete them.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How to delete cells with a given data?

This little macro will clear any cell that contains "sadness":

Sub MakeHappy()
Dim rr As Range, r As Range
Dim s As String, rClear As Range
Set rr = ActiveSheet.UsedRange
s = "sadness"
For Each r In rr
If InStr(r.Value, s) 0 Then
If rClear Is Nothing Then
Set rClear = r
Else
Set rClear = Union(rClear, r)
End If
End If
Next
If rClear Is Nothing Then
Else
rClear.Clear
End If
End Sub

hopefuly it will make you "happy"!
--
Gary''s Student - gsnu201001


"Teka" wrote:

I'm trying to delete series of cells with a given word inside, but there are
too many to FIND one by one and delete them.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default How to delete cells with a given data?

Use Edit Replace and replace with nothing. E.g "Cat" part cell match.


--
Regards
Dave Hawley
www.ozgrid.com
"Teka" wrote in message
...
I'm trying to delete series of cells with a given word inside, but there
are
too many to FIND one by one and delete them.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to delete cells with a given data?

What does delete mean?

1. Delete the contents of the cell?
2. Delete the cell (and move up or move left)?
3. Delete the entirerow?

If it's #1, you can:

Select the range
Edit|replace
What: *yourwordhere* (the asterisks are wild card. You want to include them.)
with: (leave blank)
replace all



Teka wrote:

I'm trying to delete series of cells with a given word inside, but there are
too many to FIND one by one and delete them.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to delete cells with a given data?

EditFindFind All

With the "found" dialog box open hit CTRL + a to select all "founds"

EditDelete or EditClear Contents or your choice.


Gord Dibben MS Excel MVP


On Fri, 2 Apr 2010 01:03:01 -0700, Teka
wrote:

I'm trying to delete series of cells with a given word inside, but there are
too many to FIND one by one and delete them.


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
delete columns if cells have no data wizardmalcolm Excel Discussion (Misc queries) 2 August 5th 09 03:06 PM
Delete cells containing specific data? Mobility Guy Excel Discussion (Misc queries) 1 March 22nd 07 08:29 PM
How do I delete only part of the data in a row of cells? chelldog Excel Worksheet Functions 2 October 13th 06 06:20 PM
Delete data in cells that don't meet criteria SITCFanTN New Users to Excel 1 June 10th 06 09:03 PM
How do I delete cells in Excel without changing the data in others Gemma Excel Discussion (Misc queries) 1 January 16th 06 01:49 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"