I'm trying to reduce an Excel 2010 file in size by clearing the contents of cells where a formula has returned a zero value. I have found this VBA script which does the job but not very well for the data set I'm working with:
Sub delzero()
For Each Cell In [W12:BF24459]
If Cell.Value = "0" Then Cell.ClearContents
Next Cell
End Sub
It will work for one column e.g.[W12:W24459], although very slowly but I need to do the whole data set [W12:BF24459}.
Does anyone have some VBA code to do this quickly and without crashing the file?
Thanks in advance
Sub delzero()
For Each Cell In [W12:BF24459]
If Cell.Value = "0" Then Cell.ClearContents
Next Cell
End Sub
It will work for one column e.g.[W12:W24459], although very slowly but I need to do the whole data set [W12:BF24459}.
Does anyone have some VBA code to do this quickly and without crashing the file?
Thanks in advance