Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all cells with a "x" in them
You are using the wrong code. It should be :-
'------------------------------------- Sub test() For Each c In Sheets("CDPTS").Range("B1:B363").Cells If c.Value = "x" Then c.ClearContents End If Next End Sub '------------------------------------------ It is bad programming practice to use a 'reserved word' in a macro. In this case "Cell" already has meaning in VBA. You may get away with it sometimes, but this can cause chaos in a large program - or when Excel decides it has had enough. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can I disable "cutting cells" and "drag and drop "in excel ? | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
DELETE CELLS w/ "DIV/0" MACRO | Charts and Charting in Excel | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
Any way to use toolbar button to delete cells and move cells "up"? | Excel Discussion (Misc queries) |