Need Help Deleting Rows on all sheets (Quick) (VBA/Macro)

joshmorris23xx

New Member
Joined
Jul 29, 2018
Messages
2
Hi all,

Looking for a macro to achieve the following.

In column AA of a sheet named "Welcome" no quotes, I have various text in its cells.
If the cell does not contain the word "facts" no quotes in it, I would like to have that row deleted from ALL sheets in the workbook, and not leave any white empty space.

For example, cell AA1 says "facts hi", since it contains "facts", Row 1 should remain on all sheets.
Cell AA2 says "bye", since it does not contain facts, Row 2 should be entirely deleted from all sheets in the workbook.


All help appreciated getting this done!
 
Here's another way :
Code:
Sub FT()
Dim rng$, rng2$, ws As Worksheet
rng = Range([AA2], Cells(Rows.Count, "AA").End(xlUp)).Address
Range(rng) = Evaluate("if(isnumber(search(""facts""," & rng & "))," & rng & ",0/0)")
rng2 = Range(rng).SpecialCells(xlCellTypeConstants, 16).Address
For Each ws In Worksheets
    ws.Range(rng2).EntireRow.Delete
Next
End Sub
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
@joshmorris23xx
Your thread title includes "Quick". Just checking if any suggested codes that do what you require are "Quick" enough for you? If any do what you want but are not quick enough, please identify those codes.
.. or did you just mean you wanted quick help. :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,089
Messages
6,128,760
Members
449,466
Latest member
Peter Juhnke

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