Macro for deleting cells with "None" and "0" in a column

XxMariaxX

New Member
Joined
Jul 21, 2011
Messages
9
Hi All,

I am looking to see if there is a VBA code to go through column "AO" which starst at row 3 andgoes until the last row whatever that might be..(50 for now). It will look for "None" and "0" and delete it from the cell if its there.

Please help.

Thank you.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
try this

Code:
Sub Remove_None_0()
Dim LR As Long
LR = ActiveSheet.Range("AO" & Rows.Count).End(xlUp).Row
For i = 3 To LR
    If Cells(i, "A0") = "None" Or Cells(i, "A0") = 0 Then
        Cells(i, "A0").Clear
    End If
Next i
MsgBox "Done"
End Sub
 
Upvote 0
I forgot to mention that the cell could contain other data.. so it could look like this :

FAC 50 60
IC 112 31
(None) 0 0
(None) 0 0
MC 34 67

And i want the cell to end up looking like this:

FAC 50 60
IC 112 31
MC 34 67

All of this is in colum AO..


Thanks
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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