View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default delete zero's from numbers

Lot's of great solutions:


1. select the cells and pull-down:
Edit Replace put 000 in the find what and leave the replace empty

2. select the cells and pull-down:
Edit Replace and put 0 in the find what and leave the replace empty
this will also remove internal zeros

3. the macro solution:
Sub zerokiller()
Dim s As String
For Each r In Selection
s = r.Value
s = Application.WorksheetFunction.Substitute(s, "0", "")
r.Value = s
Next
End Sub


--
Gary''s Student


"Kathy Marie" wrote:

I need a macro that can delete zero's from a range of cells-the numbers all
start with 0 for example-000222, next cell 000228.
I want to delete the zeros but leave the rest of the number. when I write a
macro, it replaces the number with a constant rather than leaving the new
number in each cell-
can anyone help?

Thanks, Kathy Beck