Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
how to delete specific values in cells
Hi,
I have a problem with excel 2007. I want to delete some columns which include some words (like as @xxx.com.au). How to delete those colums with macro? Pls let me know. Thanks. |
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
how to delete specific values in cells
Consider:
Sub col_killer() Dim r As Range, cel As Range Dim s As String s = " Set r = Nothing For Each cel In ActiveSheet.UsedRange If cel.Value = s Then If r Is Nothing Then Set r = cel Else Set r = Union(r, cel) End If End If Next If r Is Nothing Then Else r.EntireColumn.Delete End If End Sub -- Gary's Student - gsnu2007k " wrote: Hi, I have a problem with excel 2007. I want to delete some columns which include some words (like as @xxx.com.au). How to delete those colums with macro? Pls let me know. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete cells containing specific data? | Excel Discussion (Misc queries) | |||
Count cells with specific values in the cells next to them? | Excel Worksheet Functions | |||
how to delete contents of cells having specific data | Excel Discussion (Misc queries) | |||
Macro do delete values in cells | Excel Discussion (Misc queries) | |||
Locate and delete specific cells | Excel Discussion (Misc queries) |