Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default delete zero's from numbers

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,365
Default delete zero's from numbers

Either the cells are formatted as text or have a custom format applied.

First I'd try to select the cells (or entire column) and then use
Edit | Clear | Formats
and see if that clears it up.

If not, again choose them and use
Format | Cells | [General]


"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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default delete zero's from numbers

Thanks so much,

This worked and was simple

"JLatham" wrote:

Either the cells are formatted as text or have a custom format applied.

First I'd try to select the cells (or entire column) and then use
Edit | Clear | Formats
and see if that clears it up.

If not, again choose them and use
Format | Cells | [General]


"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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default delete zero's from numbers


Enter 1 in a spare cell.

Copy the cell, select the desire range and Paste Special|Multiply.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete numbers within cells Jason New Users to Excel 5 January 12th 07 03:07 PM
IF not numbers delete djranks Excel Discussion (Misc queries) 1 December 17th 05 05:36 PM
How do I delete numbers in a cell Therese Excel Discussion (Misc queries) 2 December 1st 05 10:22 AM
Delete text while numbers remain intact Sugar_grrl Excel Worksheet Functions 2 August 15th 05 05:32 PM
How do I delete 100 account numbers from a spreadsheet colume wer. Ndubuisi Azuogu Excel Worksheet Functions 2 November 11th 04 04:11 PM


All times are GMT +1. The time now is 02:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"