How to remove numbers below 6 in a very large sheet?


Posted by Ronald on November 30, 2000 4:28 AM

Hello can anyone help me with this little problem?
I am working with a very large sheet in excel 97 with
financial data mixed with code numbers ( 1 to 6 ).
To print a report I want to delete any number below 6
automaticly. By hand it is a bit much work every time.
I tried formula's and macro's but nothing seems to work.

Thanks!

Posted by JAF on November 30, 2000 7:06 AM

You can do this with a combination of a For/Next loop and an IF statement as follows:

Select the range you want to clear values from and then run the following macro:

Sub Clear_Under_6()
For Each c In Selection
If c.Value < 6 Then
c.ClearContents
End If
Next c
End Sub

HTH - JAF



Posted by RONALD on December 03, 2000 9:46 AM

Thanks! it works perfect.