Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting rows that dont fit criteria
I am new to the Excel macro language, and I am trying to delete entire
rows from 10000+ data points if the last two digits of a 12-digit number in column A do not end in 00. Here is the macro I have, but it will only delete the cell in column A. Again, I have an entire worksheet with corresponding data that needs to be deleted. Thanks ============================ Sub Delete_numbers() Dim i As Long Dim number As string Dim last2 As string i = 1 number = ActiveCell.FormulaR1C1 For i = 1 to 1000000 number = ActiveCell.FormulaR1C1 If Not number = "" Then last2 = Right(number, 2) If Not last2 = "00" Then Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Range("A1").Select End If Else Exit For End If Next i End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting several rows with given criteria | Excel Discussion (Misc queries) | |||
deleting rows based on criteria | Excel Programming | |||
Deleting Rows if certain criteria isnt met | Excel Programming | |||
Deleting rows with a two criteria | Excel Programming | |||
Deleting rows that dont... | Excel Programming |