View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
poppy poppy is offline
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