View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
D.Parker D.Parker is offline
external usenet poster
 
Posts: 31
Default Shift Rows Up After Row Deletion and Continually Repeat

I ran this and it deleted "everything" on my sheet. I was looking for the
following:

1.0
2.0
3.0
4.0

and so on. Can you please re-advise?

Kind regards,

D.Parker

"Gord Dibben" wrote:

Sub Delete_By_Criteria()
Dim i As Integer
Dim iLastRow As Integer
Dim Collet As String
Dim whatwant As String
Set wks = ActiveSheet
Application.ScreenUpdating = False

iLastRow = wks.Cells(Rows.Count, 1).End(xlUp).Row
For i = iLastRow To 1 Step -1
If Not wks.Cells(i, 1).Value Like "*.0" Then
wks.Rows(i).Delete
End If
Next i
Application.ScreenUpdating = True

End Sub


Gord Dibben MS Excel MVP

On Tue, 9 Oct 2007 14:10:01 -0700, D.Parker
wrote:

Hello! I would greatly appreciate your expertise on opening up a text file
and deleting rows of data if they do not meet the format of "0.0", "1.0",
"2.0", etc. After that delete any empty rows and shift the rows up to form a
consecutive numbering sequence in column A. The order of operations should
not matter as long as it is efficient, the total number of rows I'm working
with is ~7K. Your time and expertise is greatly appreciated.

Kind regards,

D.Parker