pls help!! deleting cells based on a criteria

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
guys can yu please tell me how to delete values in some cells based on a criteria..using filters etc. will delete the whole row but i only want to delete cells..do i have to use VBA or excel has some feature that can help me..thanks for the yur help with my earlier question AK...
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Howdy Rajeevbhardwaj, hear's some code that may be of assistance, using a vba loop, no filters. Wasn't sure if you wanted to clear the contents or delete the cell... Change "Test" to your string of choice or a range, etc...<pre>
Sub del()
Dim c As Range
On Error GoTo 1
2: Set c = Cells.Find("Test", MatchCase:=False, _
lookat:=xlWhole, LookIn:=xlValues)
'change Delete Shift:=xlToLeft to ClearContents to _
leave cell placement in tact
c.Delete Shift:=xlToLeft 'Shift:=xlUp for up
GoTo 2
1: End Sub</pre><pre></pre>
Hope this helps.

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-10-03 18:52
 
Upvote 0

Forum statistics

Threads
1,203,615
Messages
6,056,307
Members
444,858
Latest member
ucbphd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top