Question:
With the recorder and help on this forum I made a code (for a button). Column 'i' has got (from row 25) 'Pcs' or a number. My Macro finds Pcs and changes it to "" and than the macro deletes "" and 0's. lenght of the filled cells is variable, so I made 500 as 'end' but it never reaches that. If I run the macro, it works and does the job, but takes very long, especially because it has to do 500 lines..
Sub Fix()
Dim intEnd As Integer
Range("M1").Select
Cells.Replace What:="pcs", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
intEnd = 500
Range("I25").Select
Do Until ActiveCell.Row = intEnd
If Int(ActiveCell.Value) = 0 Then
Range(ActiveCell.Row & ":" & ActiveCell.Row).Delete
intEnd = intEnd - 1
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End sub
I was happy that I could make this macro with help of the forum and the recorder, but now I am stuck speeding it up, no real clue where to start. Does anybody has a tip?
Thanks, if more info or effort needed, please let me know.