ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding & filling blank cells (https://www.excelbanter.com/excel-programming/378798-finding-filling-blank-cells.html)

scorpiorc

Finding & filling blank cells
 
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?

Nick Hodge

Finding & filling blank cells
 
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
DTHIS
www.nickhodge.co.uk


"scorpiorc" wrote in message
...
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?



Nick Hodge

Finding & filling blank cells
 
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
DTHIS
www.nickhodge.co.uk


"scorpiorc" wrote in message
...
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?



Dave Peterson

Finding & filling blank cells
 
See one more response at your other post.

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?


--

Dave Peterson


All times are GMT +1. The time now is 09:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com