View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
electricbluelady electricbluelady is offline
external usenet poster
 
Posts: 10
Default Fill in zeros within a specified range

Hi Jessen,
Thank you so much! You came to my rescue. I truly appreciate it. :)
Regards,
--
Thank you,
Electricbluelady


"Per Jessen" wrote:

On 20 Jun., 21:23, electricbluelady
wrote:
Hi everyone,
I have a range of 30 cells in a column, but most have numbers, and some are
blank. I need to write a procedure to replace blank cells with zeros, and to
skip over existing numbers. I need to keep this within the 30 cells in my
range. Any help would be greatly appreciated!
Thank you,
Electricbluelady


Hi

Try this macro, just change the TargetRange to suit your needs.

Dim TargetRange As Range

Sub FillWithZero()
Set TargetRange = Range("A1:A30")

For Each cell In TargetRange
If cell.Value = "" Then
cell.Value = 0
End If
Next
End Sub

Regards,
Per