how to delete certain cells from a column in a large spreadsheet

catherine0619

New Member
Joined
Aug 10, 2012
Messages
2
Hello,
I have a spreadsheet that has more than 4,000 individual records I would like to remove from one column any record containing a number higher than 90.
Any help is appreciated
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You could use a filter to show all values greater than 90 and then delete all entries or better still use this macro

Code:
Sub removerows()
    lastrow = Range("A65536").End(xlUp).Row
    For I = lastrow To 1 Step -1
        If Cells(I, "B").Value > 90 Then 'Here I assumed the data to be deleted is in column B, change as appropriate
            Rows(I).Delete
        End If
    Next I
End Sub
 
Upvote 0
OK thanks!
You could use a filter to show all values greater than 90 and then delete all entries or better still use this macro

Code:
Sub removerows()
    lastrow = Range("A65536").End(xlUp).Row
    For I = lastrow To 1 Step -1
        If Cells(I, "B").Value > 90 Then 'Here I assumed the data to be deleted is in column B, change as appropriate
            Rows(I).Delete
        End If
    Next I
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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