Thread: IF?
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default IF?

Thank you very much!

Dan
-----Original Message-----
Hi
try the following macro:
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If left(Cells(row_index, 1).Value,4) = "node" then
rows(row_index).delete
End If
Next
Application.ScreenUpdating = True
End Sub

also have a look at:
http://www.xldynamic.com/source/xld.Deleting.html


--
Regards
Frank Kabel
Frankfurt, Germany


Dan wrote:
Hi:

Ho do I delete a row that strats for ex: with "node...

This is not working, unless I am putting in the code the
hole sentence:

If ActiveCell.Value.left = "Node *"
ActiveCell.EntireRow.Delete
ActiveCell.Offset(-1, 0).Select
End If
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.ClearContents
Range("A1").Select
Application.ScreenUpdating = TrueIf
ActiveCell.Value.left = "Node *" then

Thanks,

Dan

.