Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I would like to use a macro to delete any row that has the word
"delete" in one of its cells. What would this code be? Thanks! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub zero()
Set r = ActiveSheet.UsedRange nLastRow = r.Rows.Count + r.Row - 1 For i = nLastRow To 1 Step -1 For j = 1 To Columns.Count v = Cells(i, j).Value If InStr(1, v, "delete") 0 Then Cells(i, j).EntireRow.Delete Exit For End If Next Next End Sub -- Gary''s Student - gsnu200742 " wrote: I would like to use a macro to delete any row that has the word "delete" in one of its cells. What would this code be? Thanks! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try recording a macro
datafilterautofilterfilter on deletedeleteautofiter or look in the vba help index for FINDNEXT. -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ups.com... I would like to use a macro to delete any row that has the word "delete" in one of its cells. What would this code be? Thanks! |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
See also this page
http://www.rondebruin.nl/delete.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm wrote in message ups.com... I would like to use a macro to delete any row that has the word "delete" in one of its cells. What would this code be? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
deleting selected worksheets using vb code | Excel Discussion (Misc queries) | |||
Deleting Workbook_Open code | Excel Discussion (Misc queries) | |||
Deleting Code from VBA | Excel Discussion (Misc queries) | |||
programming VBE - Deleting All Code From A Module | Excel Discussion (Misc queries) | |||
Deleting ALL duplicates using Pearson's code | Excel Worksheet Functions |