Hello!
With help from Norie and your archives, I was able to produce a working script for automating a task in my office. My only issue is that my script takes a long time to run. (I run it on very large spreadsheets) I was hoping someone could help me find a way to shorten my runtime while keeping exactly the same output. Any help would be greatly appreciated.
This is my script:
Thanks!
Steve
With help from Norie and your archives, I was able to produce a working script for automating a task in my office. My only issue is that my script takes a long time to run. (I run it on very large spreadsheets) I was hoping someone could help me find a way to shorten my runtime while keeping exactly the same output. Any help would be greatly appreciated.
This is my script:
Code:
Sub Zeroremover()
Dim cell As Range
Dim aRange As Range
Set aRange = Range(Range("I1"), Range("I65536").End(xlUp))
For Each cell In aRange
If cell.Value <> "0" Then
cell.EntireRow.Hidden = True
End If
Next cell
aRange.SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Sheet2").Range("A1")
aRange.SpecialCells(xlCellTypeVisible).EntireRow.Delete
aRange.Cells.EntireRow.Hidden = False
End Sub
Thanks!
Steve