ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fill empty cells (https://www.excelbanter.com/excel-programming/362184-fill-empty-cells.html)

[email protected]

Fill empty cells
 
I am new to VBA code for excel, and here is my situation. I have
written a macro and the last part of my macro is to check for the
following:

I have a range of cells I have selected, and I need to look throughout
this range and see if there is any empty cells, if there is...I have
to fill it with a zero (0) . Does anyone have any code that would
help me here? Thanks

M.


colofnature[_9_]

Fill empty cells
 

Put this in your macro:

For Each c in Selection.Cells
If c.Value = Empty then c.Value = 0
Next


Col


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=544739


Michael[_41_]

Fill empty cells
 
Thanks soooo much...



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

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