Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting entire row if cell contains "value" - how to review everytime?
Hi~
I found this great macro which works perfectly on my dataset to delete the entire row if a cell value in column A contains a certain word. What I would like is to add a code which lets me review and hit accept/ decline every time it cycles through. What kind of code would I add to it? Thanks! ' *** delete if a cell contains "xxx" *** Sub DeleteRelay() Dim c As Range With Activesheet.Range("A:A") Do Set c = .Find("xxx", LookIn:=xlValues, lookat:=xlPart, _ MatchCase:=False) If c Is Nothing Then Exit Do c.EntireRow.Delete Loop End With End Sub ' *** *** |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting entire row if cell contains "value" - how to reviewevery time?
V wrote:
Hi~ I found this great macro which works perfectly on my dataset to delete the entire row if a cell value in column A contains a certain word. What I would like is to add a code which lets me review and hit accept/ decline every time it cycles through. What kind of code would I add to it? Thanks! [untested] ' *** delete if a cell contains "xxx" *** Sub DeleteRelay() Dim c As Range With Activesheet.Range("A:A") Do Set c = .Find("xxx", LookIn:=xlValues, lookat:=xlPart, _ MatchCase:=False) If c Is Nothing Then Exit Do if msgbox("delete?", vbYesNo) = vbYes then c.EntireRow.Delete end if Loop End With End Sub ' *** *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION | Excel Discussion (Misc queries) | |||
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! | Excel Discussion (Misc queries) | |||
"Windows in Taskbar" setting is lost everytime I close XL | Excel Discussion (Misc queries) | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) |