View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NEWER USER NEWER USER is offline
external usenet poster
 
Posts: 10
Default Code Help Needed

Problem with IsNull. I replaced with If (c) =2 Then c.Value = 1 and it
worked fine. So, I want to replace EMPTY cells with 1. What do I use or
change IsNull to? I( feel I am almost there. Thanks

"Mike H" wrote:

We may be at cross purposes over the definition of Null but try this

Sub Sonic()
Set myrange = Range("B1:B" & Cells(Rows.Count, "A").End(xlUp).Row)
For Each c In myrange
If IsNull(c) Then c.Value = 1
Next
End Sub

Mike

"NEWER USER" wrote:

I need to fill a Column (B) with a value of "1" in every cell that is null up
to the last row having a value in Column (A). There are no empty cells in
column A up to the last row with data in the spreadsheet. I can not
accomplish through a recorded macro. Can anybody help me with some coding to
accomplish this task? Thank you