Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
"Windows in Taskbar" setting is lost everytime I close XL yerk55 Excel Discussion (Misc queries) 1 December 4th 06 05:01 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 09:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"