MarkCBB
Active Member
- Joined
- Apr 12, 2010
- Messages
- 497
Hi there,
I am currently using the following code to delete zeros from a selection, however it is really slow. if there a different way of doing this?
Below is the code that I am currently using:
I am currently using the following code to delete zeros from a selection, however it is really slow. if there a different way of doing this?
Below is the code that I am currently using:
Code:
Sub Mytest()
Dim i As Integer
Dim Cnt0 As Integer
i = 0
Cnt0 = WorksheetFunction.CountIf(Selection, 0)
Cnt0 = Cnt0 + WorksheetFunction.CountIf(Selection, "<>" & 0)
Do
If ActiveCell.Value = 0 Then
ActiveCell.Value = ""
End If
ActiveCell.Offset(1, 0).Activate
i = i + 1
Loop Until i = Cnt0
End Sub