AllExperts > Excel 
Search      
Excel
Volunteer
Answers to thousands of questions
 Home · More Excel Questions · Answer Library  · Encyclopedia ·
More Excel Answers
Question Library

Ask a question about Excel
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Miguel Zapico
Expertise
I will try to answer any question that I can replicate in my current environment (I use Excel 2003 with Windows XP). This may include formula related questions on other Excel versions. Due to time limitations, I am not writing custom code to answer questions any more. Sorry for the inconvenience.

Experience
I have worked with Excel for the past 12 years, in various environments.

Organizations
NYPC (New York PC users group)

Organizations
NYPC (New York PC users group)

Education/Credentials
MCSE in Windows NT

 
   

You are here:  Experts > Computing/Technology > Microsoft Software > Excel > return blank cells as 0's

Excel - return blank cells as 0's


Expert: Miguel Zapico - 8/18/2008

Question
Hello all,
I'de like to get zeroes instead of blank spaces in a table of roughly 6,000 codes. The issue is that I run a query weekly that pastes values into 12 columns (for the months of the year) of this table. I would like to get zeroes for the months that do not have any data since that way I could get a pivot tabel to automatically pick up this data.
Thanks

Answer
You could do this manually in a couple of steps, by selecting the whole area, going to menu Edit->Goto->Special->Blanks, typing a 0 and entering it with Crtl+Enter.

You could use a macro like this, that does the same thing.
Sub FillBlanks()
  Range("A1").CurrentRegion.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "0"
End Sub

You may need to change the first part if your range doesn't start on A1, or if the current region doesn't cover the full range that you want to fill.

Hope this helps,
Miguel

Add to this Answer   Ask a Question


 
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.