Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Cell Contents IF
To all,
I have a worksheet full of numbers ( DATA1 ), I want a macro to be able to go throught this worksheet, and delete all values that are greater than or equal to 2000. Any ideas? Thanks in advance Joseph Crabtree |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Cell Contents IF
You didn't specify but try this idea
for each c in range("a1:c100") if c=2000 then c.clear next c -- Don Guillett SalesAid Software "joecrabtree" wrote in message ups.com... To all, I have a worksheet full of numbers ( DATA1 ), I want a macro to be able to go throught this worksheet, and delete all values that are greater than or equal to 2000. Any ideas? Thanks in advance Joseph Crabtree |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Cell Contents IF
Hi Joe,
dim xCell as range, xRng as range xRng = Range("A1:Z2000") '<- Replace with your range for each xCell in xRng if xCell = 2000 then xcell.clearcontents end if next xcell This should hopefully get you started, any problems then post back. James joecrabtree wrote: To all, I have a worksheet full of numbers ( DATA1 ), I want a macro to be able to go throught this worksheet, and delete all values that are greater than or equal to 2000. Any ideas? Thanks in advance Joseph Crabtree |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Cell Contents IF
I assume you don't really want them deleted, which would shift the cells
around, but just cleared. Sub test() Dim rng As Range, c As Range Set rng = ActiveSheet.UsedRange For Each c In rng If c.Value = 2000 Then c.Clear Next End Sub Mike F "joecrabtree" wrote in message ups.com... To all, I have a worksheet full of numbers ( DATA1 ), I want a macro to be able to go throught this worksheet, and delete all values that are greater than or equal to 2000. Any ideas? Thanks in advance Joseph Crabtree |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete the contents of a cell if it contains #DIV/0! Automaticall. | Excel Discussion (Misc queries) | |||
Delete ROW based on Cell Contents | Excel Discussion (Misc queries) | |||
delete contents of cell | Excel Discussion (Misc queries) | |||
Delete cell contents | Excel Discussion (Misc queries) | |||
Delete Row based on cell contents | Excel Programming |