View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Finding blank cells

Give this a whirl...

Sub FillBlanks()
Dim rng As Range

On Error Resume Next
Set rng = Columns("D").SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If Not rng Is Nothing Then rng.Value = " "

End Sub

--
HTH...

Jim Thomlinson


"scorpiorc" wrote:

I have column D that contains both data and blank cells. I need to find a
way to find the blank cells and fill them with a space. I've tried:

For Each z In Range("D1:D")
If z.Value = IsEmpty("D") Then
z = " "
End If
Next z

but get an error. Any ideas how I can do this?