Formula to automatically change one number to another number

C

Caroline ERP

I would like to know how I can change a number to another automatically.

I bring data into excel from another source. All the zeros which come
across I want to populate with 0.5 . I want to apply this formula to my
template so it is done automatically and I don't have to use the find and
replace function.

Thanks

Caroline
 
G

Gary''s Student

Try this small macro:

Sub caroline()
Dim r As Range
Dim rr As Range
Set rr = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
For Each r In rr
If IsEmpty(r) Then
Else
If r.Value = 0 Then
r.Value = 0.5
End If
End If
Next
End Sub
 
Top