View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PHisaw PHisaw is offline
external usenet poster
 
Posts: 24
Default Formula Not Working Properly

J_Knowles,

Thanks so much for your help. It worked just as needed.

Pam

"J_Knowles" wrote:

Here is the part about "*09" and "*10". This will delete rows with *09 or
*10 dates.

Sub DeleteRows()
With ActiveSheet
Firstrow = .UsedRange.Cells(1).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
End With
For Lrow = Lastrow To Firstrow Step -1
If Not IsError(Cells(Lrow, 1).Value) Then
If Cells(Lrow, 1).Value Like "*10" Or _
Cells(Lrow, 1).Value Like "*09" Then
ActiveSheet.Cells(Lrow, 1).EntireRow.Delete
End If
End If
Next Lrow
End Sub

HTH,
--
Data Hog


"PHisaw" wrote:


Also, using part of Ron deBruin's code for deleting rows based on data in
cells, how can I search for two entries ("*09" and "*10") without having to
copy all the code again for second search?


Firstrow = .UsedRange.Cells(1).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row

For Lrow = Lastrow To Firstrow Step -1

With .Cells(Lrow, "A")

If Not IsError(.Value) Then

If .Value Like "*10" Then .EntireRow.Delete

End If

End With

Next Lrow


I really appreciate your time and help.
Thanks again,
Pam