Finding & filling blank cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
This puts a space in every blank cell in column D

Sub SpaceInBlankColD()
Range("D:D").SpecialCells(xlCellTypeBlanks).Value = " "
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk
 
Strangely after testing it applies a space to all the blank cells in column
D within the UsedRange...strange.

Anyhow, probably what the OP wants anyhow

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk
 
See one more response at your other post.
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top