Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my worksheet I have several rows that I want to delete based on a flag
value from other calculations. What I need to do is set the value in column O to "delete", for the corresponding row, IF the value in column M is 0. Logic is like this: IF M 0, then set O="Delete" Can you help? Thanks in advance! Scott |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
You could use an Autofilter, to filter out the strictly positive values in column M. Then go to column O, select the whole column, hit F5 Special... visible cells, hit Delete. -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "porter444" wrote: In my worksheet I have several rows that I want to delete based on a flag value from other calculations. What I need to do is set the value in column O to "delete", for the corresponding row, IF the value in column M is 0. Logic is like this: IF M 0, then set O="Delete" Can you help? Thanks in advance! Scott |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Scott,
Try something like this: Sub test() Dim c As Range For Each c In Application.Intersect(ActiveSheet.UsedRange, ActiveSheet.Range("M:M")) If IsNumeric(c.Value) And c.Value 0 Then c.Offset(0, 2).Value = "delete" End If Next c End Sub -- Hope that helps. Vergel Adriano "porter444" wrote: In my worksheet I have several rows that I want to delete based on a flag value from other calculations. What I need to do is set the value in column O to "delete", for the corresponding row, IF the value in column M is 0. Logic is like this: IF M 0, then set O="Delete" Can you help? Thanks in advance! Scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
"Disk is Full" add-on question to "Can't reset last cell" post tod | Excel Discussion (Misc queries) | |||
Validation question - allow -500%, 0%, "=50%*50%" but forbid "A", "", " ", "-" ? | Excel Programming | |||
How do I delete "Type A Question for Help" | Excel Programming | |||
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc | Excel Programming |