PC Review


Reply
Thread Tools Rate Thread

Converting numeric data in Spreadsheet to zero

 
 
deepakgoyal
Guest
Posts: n/a
 
      26th May 2006

Hi

I am working on a excel spreadsheet. It contains text dat and numeric
data. what I am looking for is that I need to convert that numeric data
into 0. I mean there are cells which contains values like 234, 22, 12
etc and they blank cells in between them. So is there a way by writing
a command or Macro to convert that numeric data to 0, ie each field
must contain a value 0
..
Thank you very much in advance
Deepak


--
deepakgoyal
------------------------------------------------------------------------
deepakgoyal's Profile: http://www.excelforum.com/member.php...o&userid=34839
View this thread: http://www.excelforum.com/showthread...hreadid=545849

 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      26th May 2006
Enter and run this small macro:

Sub kill_number()
Dim r As Range
For Each r In ActiveSheet.UsedRange
If Application.IsNumber(r.Value) Then
r.Value = 0
End If
Next
End Sub

If you need help installing this macro, see:


http://www.cpearson.com/excel/codemods.htm
--
Gary's Student


"deepakgoyal" wrote:

>
> Hi
>
> I am working on a excel spreadsheet. It contains text dat and numeric
> data. what I am looking for is that I need to convert that numeric data
> into 0. I mean there are cells which contains values like 234, 22, 12
> etc and they blank cells in between them. So is there a way by writing
> a command or Macro to convert that numeric data to 0, ie each field
> must contain a value 0
> .
> Thank you very much in advance
> Deepak
>
>
> --
> deepakgoyal
> ------------------------------------------------------------------------
> deepakgoyal's Profile: http://www.excelforum.com/member.php...o&userid=34839
> View this thread: http://www.excelforum.com/showthread...hreadid=545849
>
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      26th May 2006
One more way:

Option Explicit
Sub testme()

On Error Resume Next
Worksheets("Sheet1").UsedRange _
.Cells.SpecialCells(xlCellTypeConstants, xlNumbers).Value = 0
On Error GoTo 0

End Sub

You may want to be more specific with the range, though. (Remember that Time
and Dates are just numbers to excel.)

deepakgoyal wrote:
>
> Hi
>
> I am working on a excel spreadsheet. It contains text dat and numeric
> data. what I am looking for is that I need to convert that numeric data
> into 0. I mean there are cells which contains values like 234, 22, 12
> etc and they blank cells in between them. So is there a way by writing
> a command or Macro to convert that numeric data to 0, ie each field
> must contain a value 0
>
> Thank you very much in advance
> Deepak
>
> --
> deepakgoyal
> ------------------------------------------------------------------------
> deepakgoyal's Profile: http://www.excelforum.com/member.php...o&userid=34839
> View this thread: http://www.excelforum.com/showthread...hreadid=545849


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arithmetic overflow error converting numeric to data type numeric. darrel Microsoft ASP .NET 4 19th Jul 2007 10:57 PM
Converting numeric data into 0 in spreadsheet deepakgoyal Microsoft Excel Programming 1 26th May 2006 03:07 PM
Re: Arithmetic overflow error converting numeric to data type numeric John Microsoft Access 0 1st Nov 2004 09:24 AM
Re: Arithmetic overflow error converting numeric to data type numeric Leonardo Ezequiel Weite Microsoft Access Queries 0 8th Sep 2004 12:50 AM
Re: Arithmetic overflow error converting numeric to data type numeric Leonardo Ezequiel Weite Microsoft Access 0 8th Sep 2004 12:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 AM.