LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make all empty cells in columns = 0

Hi

How would I change or modify this code to look for all empty cell an
make them equal to 0.

eg

From this:

A B
2


To look like this

A B
2 0


Code
-------------------
lastrow = Cells(Rows.Count, "A").End(xlUp).Row

For i = 3 To 31 Step 2
For j = 3 To lastrow Step 1
With Cells((j), (i))
If j = Val("") Then ' or j < 0 Then
Cells(j) = 0
End If
End With
Next
Nex
-------------------


I have tried different things but keep them this "#VALUE!

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make a Chart data series treat blanks as "Empty" cells XLADLK Charts and Charting in Excel 12 June 9th 08 10:53 PM
How do I make sure all empty columns are present in a .csv file? Decision Assist Excel Worksheet Functions 1 September 6th 06 04:40 PM
How to make Excel Chart not to display empty cells? Marko Pinteric Charts and Charting in Excel 6 April 5th 06 09:03 PM
How to make Excel Chart not to display empty cells? Marko Pinteric Excel Discussion (Misc queries) 6 April 5th 06 09:03 PM
How to make empty cells as zero in excel add-ins for SQL Server an Microlong Excel Worksheet Functions 0 January 12th 05 06:31 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"