I want to delete rows containing the text " file not submitted" in in column "a" across multiple sheets of a workbook

Qazi Sharifullah

New Member
Joined
May 11, 2017
Messages
19
A.a
i need help about this :
I want to delete rows containing the text " file not submitted" in column "a" across multiple sheets of a workbook.


Thanks in advance
qazi sharifullah
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try:
Code:
Sub DeleteRows()
    Application.ScreenUpdating = False
    Dim ws As Worksheet
    On Error Resume Next
    For Each ws In Sheets
        ws.Columns("A").Replace "file not submitted", "#N/A", xlWhole, , False
        ws.Columns("A").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
    Next ws
    On Error GoTo 0
    Application.ScreenUpdating = True
End Sub
Please note that this will delete the rows on all the worksheets. If you want to exclude any sheets, the macro will have to be modified.
 
Upvote 0
Try:
Code:
Sub DeleteRows()
    Application.ScreenUpdating = False
    Dim ws As Worksheet
    On Error Resume Next
    For Each ws In Sheets
        ws.Columns("A").Replace "file not submitted", "#N/A", xlWhole, , False
        ws.Columns("A").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
    Next ws
    On Error GoTo 0
    Application.ScreenUpdating = True
End Sub
Please note that this will delete the rows on all the worksheets. If you want to exclude any sheets, the macro will have to be modified.



Thanks a lot its working, thanks so much.
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top