Delete Everything Except.........Help pls

omegadeltaphi

New Member
Joined
Jul 10, 2011
Messages
30
I am trying to delete everything in one column except for the rows that contain the word "Active" all other cells need to simply remain blank.




Thanks in Advance

Steve
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Since you didn't tell us, I'll assume that column is Column A. Again, because you didn't tell us, I am also going to assume that this column does not contain any formulas. Given these assumptions, here is a macro for you to try...
Code:
Sub KeepActives()
  On Error Resume Next
  With Columns("F")
    .Replace "Active", "=Active", xlWhole
    .SpecialCells(xlCellTypeConstants).ClearContents
    .SpecialCells(xlCellTypeFormulas).Value = "Active"
  End With
End Sub
 
Upvote 0
B column.

I only have two columns and many rows.

this did not work????
Please answer all the questions so we will know how to proceed...

Columns A and B?

Can the "Active" word be in either column or just one (which one if only one)?

Did you want both cells in the row cleared or only the one with the word "Active" in it?

If both cells, did you want the cells below it to move up or just leave the blank row in place?

Are there any formulas in the cells?
 
Upvote 0
Can the "Active" word be in either column or just one (which one if only one)? It is in column B

Did you want both cells in the row cleared or only the one with the word "Active" in it? I need all the cells in column B cleared except for "active"

If both cells, did you want the cells below it to move up or just leave the blank row in place? Blank

Are there any formulas in the cells? No

Column A Column B

info &%!*
info *%@#
info active
------------------------------------------------

i need to get rid of all the bad words.

sorry for not making myself clear.

Thx Rick


Steve<!-- / message -->
 
Upvote 0
Okay, give this macro as try...
Code:
Sub KeepActives()
  On Error Resume Next
  With Columns("B")
    .Replace "Active", "=Active", xlWhole
    .SpecialCells(xlCellTypeConstants).ClearContents
    .SpecialCells(xlCellTypeFormulas).Value = "Active"
  End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,735
Members
452,939
Latest member
WCrawford

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