Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Replace blank cells with 0

I need a code that will search a range (let's say A1:Z1) and will replace any
blank cells with a zero (0).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Replace blank cells with 0

If true blanks.............

Sub Zeros()
Dim rng As Range
Set rng = Nothing
On Error Resume Next 'just in case there are no blanks
Set rng = Range("A1:Z1").SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If rng Is Nothing Then
'do nothing
Else
rng.Value = 0
End If
End Sub


Gord Dibben MS Excel MVP

On Thu, 18 Jun 2009 07:32:01 -0700, scrabtree23
wrote:

I need a code that will search a range (let's say A1:Z1) and will replace any
blank cells with a zero (0).


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
Replace blank cells with 0 Patrick Molloy Excel Programming 0 June 18th 09 03:57 PM
Replace blank cells with 0 Jim Thomlinson Excel Programming 0 June 18th 09 03:51 PM
Replace blank cells with NONE TimT Excel Programming 3 July 7th 06 11:04 PM
Replace cells with blank diggers Excel Worksheet Functions 1 November 17th 05 12:23 AM
Replace cells with blank Elkar Excel Worksheet Functions 0 November 16th 05 10:21 PM


All times are GMT +1. The time now is 03:36 AM.

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

About Us

"It's about Microsoft Excel"