Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
assume column 3 (C) is where the x's appear
set rng = Columns(3).Specialcells(xlconstants,xltextvalues) for each cell in rng if lcase(cell.value) = "x" then if rng1 is nothing then set rng1 = cell else set rng1 = union(rng1,cell) end if end if Next if not rng1 is nothing then rng1.EntireRow.Delete ' to delete the row Or 'rng1.offset(0,1).ClearContents ' to just clear the cell to the right Of course if the only thing in this column will be the x's then you don't need to do the looping Columns(3).Specialcells(xlconstants,xltextvalues). EntireRow.Delete as an example. -- Regards, Tom Ogilvy "Husker87" wrote in message ... I have a list of items in a column. (say 20) I would like to be able to enter an "x" in the cell to the left of certain items (say 4 of them) and then run a macro that will delete the items. Does anyone have any ideas? I need to be able to indicate with an "x" which items are no longer valid and then run the macro at the end of a shift and clear just those items marked with an "x". Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to run macro automatically from range of cells | Excel Worksheet Functions | |||
Can I automatically add or delete cells based on IF statements | Excel Discussion (Misc queries) | |||
Macro to Delete blank cells | Excel Worksheet Functions | |||
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? | Excel Discussion (Misc queries) | |||
have Macro automatically delete and create sheets | Excel Programming |