ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Links and Linking in Excel (https://www.excelbanter.com/links-linking-excel/)
-   -   macro to fill blank cells (https://www.excelbanter.com/links-linking-excel/78987-macro-fill-blank-cells.html)

Sunny

macro to fill blank cells
 
Hello,

i have to update all cells with zero if it is blank according to a
particlular date.
In other words,

if the date is todays date and the cells are blank, then i need to put zero
in each of those cells.

i was thinking wheter i can write a macro on it so that i need no do it
manually for each and every sheet.

can anyone help me out on this.

thanks & Regards,
sunny.
:)

Ken Wright

macro to fill blank cells
 
Try selecting your range, doing Edit / Go To / Special / Blanks, then type 0
and hit CTRL+ENTER to enter it in all blank cells. If you record a macro
doing that you can then have it run for every sheet by wrapping it in
something like:-

Sub abc()
For Each sht In ActiveWorkbook.Worksheets
sht.Activate
Range("A1:F100").SpecialCells(xlCellTypeBlanks).Va lue = 0
Next sht
End Sub

or

Sub abc()
For Each sht In ActiveWorkbook.Worksheets
Range("A1:F100").SpecialCells(xlCellTypeBlanks).Va lue = 0
Next sht
End Sub

First way activates each sheet and second doesn't.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------



"Sunny" <u19980@uwe wrote in message news:5da44791832c9@uwe...
Hello,

i have to update all cells with zero if it is blank according to a
particlular date.
In other words,

if the date is todays date and the cells are blank, then i need to put
zero
in each of those cells.

i was thinking wheter i can write a macro on it so that i need no do it
manually for each and every sheet.

can anyone help me out on this.

thanks & Regards,
sunny.
:)





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

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